New Question
0

Windows 10 Hostname not set correctly

asked 2015-08-01 17:17:21 +0200

HD gravatar image

Hi,

I install latest stable build of Cloudbase for Windows x64 on Windows 10 Enterprise N edition. Syspreped it created an image.

Deployed the image and passed an init script.

The hostname is not getting set correctly. However, I do see that Cloud Init is starting on boot and getting the correct hostname from Metadata service.

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>hostname
DESKTOP-ROSFNJ5

The Cloud init log file get the correct metadata from 169.254.169.254

2015-08-01 12:09:44.036 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:48.599 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.configdrive.ConfigDriveService' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:49.006 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.osconfigdrive.windows.WindowsConfigDriveManager' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:49.209 1888 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive in VFAT filesystems get_config_drive_files C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:162
2015-08-01 12:09:49.209 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:50.161 1888 WARNING cloudbaseinit.utils.windows.vfat [-] Could not retrieve label for VFAT drive path '\\\\.\\PHYSICALDRIVE0'
2015-08-01 12:09:50.161 1888 WARNING cloudbaseinit.utils.windows.vfat [-] mlabel failed with error "init :: sector size (190) not a small power of two\r\nCannot initialize '::'\r\nC:\\Program Files (x86)\\Cloudbase Solutions\\Cloudbase-Init\\bin\\mlabel: Cannot initialize drive\r\n"
2015-08-01 12:09:50.161 1888 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive in raw HDDs get_config_drive_files C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:166
2015-08-01 12:09:50.177 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:50.177 1888 DEBUG cloudbaseinit.metadata.services.osconfigdrive.windows [-] Looking for Config Drive in cdrom drives get_config_drive_files C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\metadata\services\osconfigdrive\windows.py:171
2015-08-01 12:09:50.177 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:50.177 1888 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.metadata.services.httpservice.HttpService' load_class C:\Program Files (x86)\Cloudbase Solutions\Cloudbase-Init\Python27\lib\site-packages\cloudbaseinit\utils\classloader.py:26
2015-08-01 12:09:50.272 1888 DEBUG cloudbaseinit.utils.classloader ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2015-08-02 17:03:46 +0200

HD gravatar image

The URL you gave is not present on my setup. However, I can see the hostname correctly passed via this URL

PS C:\Users\Administrator> Invoke-WebRequest http://169.254.169.254/latest/meta-data/hostname -UseBasicParsing


StatusCode        : 200
StatusDescription : OK
Content           : hdent4
RawContent        : HTTP/1.1 200 OK
                    Content-Length: 6
                    Content-Type: text/html; charset=UTF-8
                    Date: Sun, 02 Aug 2015 13:27:55 GMT

                    hdent4
Forms             :
Headers           : {[Content-Length, 6], [Content-Type, text/html; charset=UTF-8], [Date, Sun, 02 Aug 2015 13:27:55
                    GMT]}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        :
RawContentLength  : 6

Hostname is set via the Metadata. I don't think Init Script has anything to do with it. I get the same results even when I don;t pass any inti script

edit flag offensive delete link more

Comments

Sorry, there was a typo in the url I pasted in my previous answer, I just corrected it. If you could please retrieve the content as requested it'd be very useful as it includes the hostname assigned by Nova.

alexpilotti gravatar imagealexpilotti ( 2015-08-03 04:13:04 +0200 )edit

I deleted the original machine. I created a new one with name hdtest1. Here is the meta_data.json {"random_seed": "cBjezGwAMbexbEAtuLZoF6WW5QGOYb1fIRlR4Da9JdoBw06+3/g+LnqGqEjUSRSrnLbNcooXsEVdwK5054s23cm/HefGyPjgHlbt17cC1A1AGptacYU0WKGZYg1ZpiMbKM6iT4MBDCL8RnYXabq7P+kOpFTYqQ5qHDKo5aSQgQ4sYjNpRYAVMUq20xOT5nYy69XZU2sgv7cICdLjSCzud2m2YGTgSdSZh9Y4HtH6EKLFVQbgHr+HBi78LFCfe9HnJa6jBECUyFxq/lctpBlqb3dksQmSC53yIQrTMGnNeBUuDix+3PULlY2PORZc+fnm497bt+sr55gyU0N6OZqf+u2xc8kOokc+RjHaoAsbft0hMyrR3nkn0pTsMXpbzq4KPb3jVqMWJ2eV13kFuWWPN9aTkRKYygHPao4b1rVYuHQv+I9Wy8kGHJ1TnELRlpQBjm/0pOnwLNTWRofdM9n8Zxxnwo5Ws2P1+tbYkadjTqjBIfl8R04ZLkvbzzoHOo9rQUW+3QImlaaS5ic3eAOEVsXCbtxJhLgfqNydbisFIPt8MHA23PlhwCoOX6wgwNX1EQOEOZrihGnYalZU/pocuRpAm5RQ7NLVsp4qjatSuamgmDdHZ5+kd+QdMcYCTBOdDC9aCmaqqg4tWBeMbNC0IsciKctKVYh2x9MJiFWF4og=", "uuid": "37c78fa7-033a-4244-8edc-6984c40516a7", "availability_zone": "Production", "hostname": "hdtest1", "launch_index": 0, "name": "hdtest1"}

HD gravatar imageHD ( 2015-08-03 04:57:39 +0200 )edit

Hi HD. I tried to debug this, but unfortunately I'm not able to reproduce it. I got the following log using the stable cloudbaseinit and the official Windows 10 release: http://paste.openstack.org/show/406901/. The hostname changes and it's persistent across restarts.

cpopa gravatar imagecpopa ( 2015-08-04 19:15:27 +0200 )edit
0

answered 2015-08-01 23:10:30 +0200

alexpilotti gravatar image

updated 2015-08-03 04:07:28 +0200

Can you add also a copy of your metadata as well?

From inside the image, in PowerShell:

Invoke-WebRequest http://169.254.169.254/openstack/latest/meta_data.json -OutFile meta_data.json

and a copy of your userdata script as well.

Please post large content in a pastebin (e.g. http://paste.openstack.org) and include the links here to ease up the review.

Thanks

edit flag offensive delete link more

Comments

I have got it working but not sure if its the right change. Check http://paste.openstack.org/show/408335/

HD gravatar imageHD ( 2015-08-05 17:02:24 +0200 )edit

By doing this the only side effect is that the hostname is set after the system setup completes, which means that it will need an extra reboot. We're now investigating what's going on in Sysprep, my suspect is that Windows 10 sets the hostname after Cloudbase-Init sets it, causing it to change

alexpilotti gravatar imagealexpilotti ( 2015-08-05 17:15:19 +0200 )edit

HI, I have the same problem with cloud-init 0.9.9. Cheers yop190

yop190 gravatar imageyop190 ( 2016-08-19 15:43:11 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-08-01 17:17:21 +0200

Seen: 2,574 times

Last updated: Aug 03 '15