{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/119","labels_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/119/comments","events_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/119/events","html_url":"https://github.com/Azure/WALinuxAgent/issues/119","id":113852443,"number":119,"title":"Sometimes hostname not updated by waagent","user":{"login":"mhmxs","id":4972503,"avatar_url":"https://avatars.githubusercontent.com/u/4972503?v=3","gravatar_id":"","url":"https://api.github.com/users/mhmxs","html_url":"https://github.com/mhmxs","followers_url":"https://api.github.com/users/mhmxs/followers","following_url":"https://api.github.com/users/mhmxs/following{/other_user}","gists_url":"https://api.github.com/users/mhmxs/gists{/gist_id}","starred_url":"https://api.github.com/users/mhmxs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhmxs/subscriptions","organizations_url":"https://api.github.com/users/mhmxs/orgs","repos_url":"https://api.github.com/users/mhmxs/repos","events_url":"https://api.github.com/users/mhmxs/events{/privacy}","received_events_url":"https://api.github.com/users/mhmxs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-28T15:47:20Z","updated_at":"2015-10-28T17:43:29Z","closed_at":null,"body":"In some cases waagent doesn't update the hostname and stay localhost.localdomain. I started two machines in the same time. Here some information where hostname update failed:\r\n- /var/lib/waagent/ovf-env.xml\r\n```\r\n<Environment xmlns=\"http://schemas.dmtf.org/ovf/environment/1\" xmlns:oe=\"http://schemas.dmtf.org/ovf/environment/1\" xmlns:wa=\"http://schemas.microsoft.com/windowsazure\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n    <wa:ProvisioningSection><wa:Version>1.0</wa:Version><LinuxProvisioningConfigurationSet xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType><HostName>vmmaster1</HostName><UserName>asd</UserName><DisableSshPasswordAuthentication>true</DisableSshPasswordAuthentication><SSH><PublicKeys><PublicKey><Fingerprint>750...</Fingerprint><Path>/home/asd/.ssh/authorized_keys</Path></PublicKey></PublicKeys></SSH><CustomData>IyEvYmluL.....</CustomData></LinuxProvisioningConfigurationSet></wa:ProvisioningSection>\r\n  <wa:PlatformSettingsSection><wa:Version>1.0</wa:Version><PlatformSettings xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><KmsServerHostname>kms.core.windows.net</KmsServerHostname><ProvisionGuestAgent>true</ProvisionGuestAgent><GuestAgentPackageName>VMAgentPackage.zip</GuestAgentPackageName></PlatformSettings></wa:PlatformSettingsSection>\r\n</Environment>\r\n```\r\n- /var/log/waagent.log\r\n```\r\n2015/10/28 13:00:40 Windows Azure Linux Agent Version: WALinuxAgent-2.0.14\r\n2015/10/28 13:00:41 Linux Distribution Detected      : centos\r\n2015/10/28 13:00:41 Module /lib/modules/3.10.0-229.7.2.el7.x86_64/kernel/drivers/ata/ata_piix.ko driver for ATAPI CD-ROM is already present.\r\n2015/10/28 13:00:41 mount: /dev/sr0 is write-protected, mounting read-only\r\n2015/10/28 13:00:41 mount: /dev/sr0 mounted on /mnt/cdrom/secure.\r\n2015/10/28 13:00:41 mount succeeded on attempt #1\r\n2015/10/28 13:00:41 VMM Init script not found.  Provisioning for Azure\r\n2015/10/28 13:00:41 Waiting for network.\r\n2015/10/28 13:00:51 IPv4 address: 10.0.0.4\r\n2015/10/28 13:00:51 MAC  address: 00:0D:3A:21:3D:EF\r\n2015/10/28 13:00:51 Probing for Windows Azure environment.\r\n2015/10/28 13:00:51 DoDhcpWork: Setting socket.timeout=10, entering recv\r\n2015/10/28 13:00:52 Discovered Windows Azure endpoint: 168.63.129.16\r\n2015/10/28 13:00:52 Fabric preferred wire protocol version: 2015-04-05\r\n2015/10/28 13:00:52 Negotiated wire protocol version: 2012-11-30\r\n2015/10/28 13:00:52 SetBlockDeviceTimeout: Update the device sda with timeout 300\r\n2015/10/28 13:00:52 SetBlockDeviceTimeout: Update the device sdb with timeout 300\r\n2015/10/28 13:00:52 SetBlockDeviceTimeout: Update the device sdc with timeout 300\r\n2015/10/28 13:00:52 Retrieved GoalState from Windows Azure Fabric.\r\n2015/10/28 13:00:52 ExpectedState: Started\r\n2015/10/28 13:00:52 ContainerId: 97d26...\r\n2015/10/28 13:00:52 RoleInstanceId: 0473...master1\r\n2015/10/28 13:00:53 Public cert with thumbprint: 750A2... was retrieved.\r\n2015/10/28 13:00:53 Provisioning image started.\r\n2015/10/28 13:00:53 Detect GPT...\r\n2015/10/28 13:00:53 mount: /dev/sr0 is write-protected, mounting read-only\r\n2015/10/28 13:00:53 mount succeeded on attempt #1\r\n2015/10/28 13:00:53 Provisioning image using OVF settings in the DVD.\r\n2015/10/28 13:00:53 Wrote /var/lib/waagent/CustomData\r\n2015/10/28 13:00:53 Disabled SSH password-based authentication methods.\r\n2015/10/28 13:00:55 Created user account: asd\r\n2015/10/28 13:00:55 Deploy public key:750A...\r\n2015/10/28 13:00:55 Ovf XML process finished\r\n2015/10/28 13:00:55 Posted Role Properties. CertificateThumbprint=70ee...\r\n2015/10/28 13:00:55 Root password deleted.\r\n2015/10/28 13:00:55 Provisioning image completed.\r\n2015/10/28 13:00:55 Posted Role Properties. CertificateThumbprint=70ee...\r\n2015/10/28 13:00:56 Resource disk (/dev/sdb1) is mounted at /mnt/resource with fstype ext4\r\n2015/10/28 13:00:57 EnvMonitor: Detected dhcp client restart. Restoring routing table.\r\n2015/10/28 13:01:00 Finished processing ExtensionsConfig.xml\r\n2015/10/28 13:01:00 ERROR:Traceback (most recent call last):\r\n2015/10/28 13:01:00 ERROR:  File \"/usr/sbin/waagent\", line 4806, in AddSystemInfo\r\n2015/10/28 13:01:00 ERROR:    sharedConfig = xml.dom.minidom.parse(\"/var/lib/waagent/SharedConfig.xml\").childNodes[0]\r\n2015/10/28 13:01:00 ERROR:  File \"/usr/lib64/python2.7/xml/dom/minidom.py\", line 1921, in parse\r\n2015/10/28 13:01:00 ERROR:    return expatbuilder.parse(file)\r\n2015/10/28 13:01:00 ERROR:  File \"/usr/lib64/python2.7/xml/dom/expatbuilder.py\", line 922, in parse\r\n2015/10/28 13:01:00 ERROR:    fp = open(file, 'rb')\r\n2015/10/28 13:01:00 ERROR:IOError: [Errno 2] No such file or directory: '/var/lib/waagent/SharedConfig.xml'\r\n2015/10/28 13:01:00 ERROR:\r\n```\r\n- /var/log/messages | grep hostname\r\n```\r\nJul 31 15:24:50 localhost systemd[1]: Set hostname to <localhost.localdomain>.\r\nJul 31 15:25:02 localhost systemd: Set hostname to <localhost.localdomain>.\r\nOct  9 16:16:00 localhost systemd[1]: Set hostname to <localhost.localdomain>.\r\nOct  9 16:16:19 localhost systemd: Set hostname to <localhost.localdomain>.\r\nOct  9 16:16:33 localhost NetworkManager[573]: <info>  Setting system hostname to 'localhost.localdomain' (no default device)\r\nOct  9 16:16:33 localhost nm-dispatcher: Dispatching action 'hostname'\r\nOct  9 16:16:34 localhost NetworkManager[573]: <info>  Setting system hostname to 'PkrVMe7xc9xgqil' (from system configuration)\r\nOct  9 16:16:34 localhost nm-dispatcher: Dispatching action 'hostname'\r\nOct 28 13:00:12 localhost systemd[1]: Set hostname to <localhost.localdomain>.\r\nOct 28 13:00:32 localhost systemd: Set hostname to <localhost.localdomain>.\r\nOct 28 13:00:53 localhost NetworkManager[608]: <info>  Setting system hostname to 'localhost.localdomain' (no default device)\r\nOct 28 13:00:53 localhost nm-dispatcher: Dispatching action 'hostname'\r\n```\r\n\r\nThe other machine, where the hostname is configured as well\r\n- /var/lib/waagent/ovf-env.xml\r\n```\r\n<Environment xmlns=\"http://schemas.dmtf.org/ovf/environment/1\" xmlns:oe=\"http://schemas.dmtf.org/ovf/environment/1\" xmlns:wa=\"http://schemas.microsoft.com/windowsazure\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n    <wa:ProvisioningSection><wa:Version>1.0</wa:Version><LinuxProvisioningConfigurationSet xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType><HostName>vmslave12</HostName><UserName>asd</UserName><DisableSshPasswordAuthentication>true</DisableSshPasswordAuthentication><SSH><PublicKeys><PublicKey><Fingerprint>750A...</Fingerprint><Path>/home/asd/.ssh/authorized_keys</Path></PublicKey></PublicKeys></SSH><CustomData>IyEvYmluL2Jhc2gK...</CustomData></LinuxProvisioningConfigurationSet></wa:ProvisioningSection>\r\n  <wa:PlatformSettingsSection><wa:Version>1.0</wa:Version><PlatformSettings xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><KmsServerHostname>kms.core.windows.net</KmsServerHostname><ProvisionGuestAgent>true</ProvisionGuestAgent><GuestAgentPackageName>VMAgentPackage.zip</GuestAgentPackageName></PlatformSettings></wa:PlatformSettingsSection>\r\n</Environment>\r\n```\r\n- /var/log/waagent.log\r\n```\r\n2015/10/28 13:01:13 Windows Azure Linux Agent Version: WALinuxAgent-2.0.14\r\n  2015/10/28 13:01:13 Linux Distribution Detected      : centos\r\n  2015/10/28 13:01:13 Module /lib/modules/3.10.0-229.7.2.el7.x86_64/kernel/drivers/ata/ata_piix.ko driver for ATAPI CD-ROM is already present.\r\n  2015/10/28 13:01:14 mount: /dev/sr0 is write-protected, mounting read-only\r\n  2015/10/28 13:01:14 mount: /dev/sr0 mounted on /mnt/cdrom/secure.\r\n  2015/10/28 13:01:14 mount succeeded on attempt #1\r\n  2015/10/28 13:01:14 VMM Init script not found.  Provisioning for Azure\r\n  2015/10/28 13:01:14 IPv4 address: 10.0.0.5\r\n  2015/10/28 13:01:14 MAC  address: 00:0D:3A:21:49:93\r\n  2015/10/28 13:01:14 Probing for Windows Azure environment.\r\n  2015/10/28 13:01:14 DoDhcpWork: Setting socket.timeout=10, entering recv\r\n  2015/10/28 13:01:14 Discovered Windows Azure endpoint: 168.63.129.16\r\n  2015/10/28 13:01:14 Fabric preferred wire protocol version: 2015-04-05\r\n  2015/10/28 13:01:14 Negotiated wire protocol version: 2012-11-30\r\n  2015/10/28 13:01:14 SetBlockDeviceTimeout: Update the device sda with timeout 300\r\n  2015/10/28 13:01:14 SetBlockDeviceTimeout: Update the device sdb with timeout 300\r\n  2015/10/28 13:01:14 SetBlockDeviceTimeout: Update the device sdc with timeout 300\r\n  2015/10/28 13:01:15 Retrieved GoalState from Windows Azure Fabric.\r\n  2015/10/28 13:01:15 ExpectedState: Started\r\n  2015/10/28 13:01:15 ContainerId: 2867...\r\n  2015/10/28 13:01:15 RoleInstanceId: 6da4...slave12\r\n  2015/10/28 13:01:15 Public cert with thumbprint: 750A2E3DE4CA53757C1D7040C445E14951774241 was retrieved.\r\n  2015/10/28 13:01:15 Provisioning image started.\r\n  2015/10/28 13:01:15 Detect GPT...\r\n  2015/10/28 13:01:16 mount: /dev/sr0 is write-protected, mounting read-only\r\n  2015/10/28 13:01:16 mount succeeded on attempt #1\r\n  2015/10/28 13:01:16 Provisioning image using OVF settings in the DVD.\r\n  2015/10/28 13:01:16 Wrote /var/lib/waagent/CustomData\r\n  2015/10/28 13:01:16 Disabled SSH password-based authentication methods.\r\n  2015/10/28 13:01:18 Created user account: asd\r\n  2015/10/28 13:01:18 Deploy public key:750A...\r\n  2015/10/28 13:01:19 Resource disk (/dev/sdb1) is mounted at /mnt/resource with fstype ext4\r\n  2015/10/28 13:01:20 EnvMonitor: Detected host name change: localhost.localdomain -> vmslave12\r\n  2015/10/28 13:01:20 Setting host name: vmslave12\r\n  2015/10/28 13:01:21 Ovf XML process finished\r\n  2015/10/28 13:01:21 Posted Role Properties. CertificateThumbprint=2371...\r\n  2015/10/28 13:01:21 Root password deleted.\r\n  2015/10/28 13:01:21 Provisioning image completed.\r\n  2015/10/28 13:01:21 Posted Role Properties. CertificateThumbprint=2371...\r\n  2015/10/28 13:01:26 Finished processing ExtensionsConfig.xml\r\n  2015/10/28 13:01:26 ERROR:Traceback (most recent call last):\r\n  2015/10/28 13:01:26 ERROR:  File \"/usr/sbin/waagent\", line 4806, in AddSystemInfo\r\n  2015/10/28 13:01:26 ERROR:    sharedConfig = xml.dom.minidom.parse(\"/var/lib/waagent/SharedConfig.xml\").childNodes[0]\r\n  2015/10/28 13:01:26 ERROR:  File \"/usr/lib64/python2.7/xml/dom/minidom.py\", line 1921, in parse\r\n  2015/10/28 13:01:26 ERROR:    return expatbuilder.parse(file)\r\n  2015/10/28 13:01:26 ERROR:  File \"/usr/lib64/python2.7/xml/dom/expatbuilder.py\", line 922, in parse\r\n  2015/10/28 13:01:26 ERROR:    fp = open(file, 'rb')\r\n  2015/10/28 13:01:26 ERROR:IOError: [Errno 2] No such file or directory: '/var/lib/waagent/SharedConfig.xml'\r\n  2015/10/28 13:01:26 ERROR:\r\n```\r\n- /var/log/messages | grep hostname\r\n```\r\nJul 31 15:24:50 localhost systemd[1]: Set hostname to <localhost.localdomain>.\r\nJul 31 15:25:02 localhost systemd: Set hostname to <localhost.localdomain>.\r\nOct  9 16:16:00 localhost systemd[1]: Set hostname to <localhost.localdomain>.\r\nOct  9 16:16:19 localhost systemd: Set hostname to <localhost.localdomain>.\r\nOct  9 16:16:33 localhost NetworkManager[573]: <info>  Setting system hostname to 'localhost.localdomain' (no default device)\r\nOct  9 16:16:33 localhost nm-dispatcher: Dispatching action 'hostname'\r\nOct  9 16:16:34 localhost NetworkManager[573]: <info>  Setting system hostname to 'PkrVMe7xc9xgqil' (from system configuration)\r\nOct  9 16:16:34 localhost nm-dispatcher: Dispatching action 'hostname'\r\nOct 28 13:00:50 localhost systemd[1]: Set hostname to <localhost.localdomain>.\r\nOct 28 13:01:05 localhost systemd: Set hostname to <localhost.localdomain>.\r\nOct 28 13:01:20 localhost NetworkManager[613]: <info>  Setting system hostname to 'localhost.localdomain' (no default device)\r\nOct 28 13:01:20 localhost nm-dispatcher: Dispatching action 'hostname'\r\nOct 28 13:01:21 localhost NetworkManager[613]: <info>  Setting system hostname to 'vmslave12' (from system configuration)\r\nOct 28 13:01:21 localhost nm-dispatcher: Dispatching action 'hostname'\r\n```\r\n\r\nThis thing not happens always, for example in the previous couple of days it appears two times, and we started 18 instances. If you need any further information please feel free to ask me.\r\n\r\nBest Regards,\r\nRichard"},"comment":{"url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/comments/151925341","html_url":"https://github.com/Azure/WALinuxAgent/issues/119#issuecomment-151925341","issue_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/119","id":151925341,"user":{"login":"yuezh","id":6800404,"avatar_url":"https://avatars.githubusercontent.com/u/6800404?v=3","gravatar_id":"","url":"https://api.github.com/users/yuezh","html_url":"https://github.com/yuezh","followers_url":"https://api.github.com/users/yuezh/followers","following_url":"https://api.github.com/users/yuezh/following{/other_user}","gists_url":"https://api.github.com/users/yuezh/gists{/gist_id}","starred_url":"https://api.github.com/users/yuezh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuezh/subscriptions","organizations_url":"https://api.github.com/users/yuezh/orgs","repos_url":"https://api.github.com/users/yuezh/repos","events_url":"https://api.github.com/users/yuezh/events{/privacy}","received_events_url":"https://api.github.com/users/yuezh/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T17:43:29Z","updated_at":"2015-10-28T17:43:29Z","body":"What is the cloud-init version the image is using? There was a bug with cloud-init that it will remove the file \"SharedConfig.xml\" which is essential for waagent."}}