You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have the following scenario: we are deprovisioning an image deployed from the Portal and use it to create a new virtual machine that has the same hostname as the original one. Once it is deployed, the hostname of the virtual machine is changed to localhost, instead of the name that we have set in the Portal, which is the name of the original VM.
Here are more details:
Customer has a VM named “Original” (hostname is then also named as Original).
We then deprovision this VM with no issues, and capture an image from the Azure Portal.
We then use this image to create a VM with the same name as the original VM named “Original”
When we then login to the VM and check the Hostname it is reported as local.host.localadmin (and not the defined Hostname/Portal VM name “Original”.
If we then use that same image to create a new VM with a separate name like “OriginalNew”, the VM will have the new Hostname that has been given.
Distro and WALinuxAgent details (please complete the following information):
Distro and Version: Ubuntu 18.04
WALinuxAgent version: 2.3.1.1
Additional context
I see a similar bug opened in 2018 that has been closed:
Ubuntu 18.04 --deprovision causes host name to become localhost · Issue #1398 · Azure/WALinuxAgent (github.com)
The workaround of adding the hostname manually in /etc/hostname works but we would not have to do that.
Log file attached
Here is a copy of the cloud.init file showing the name being changed:
2021-07-19 11:22:39,332 - init.py[DEBUG]: no work necessary for renaming of [[u'00:22:48:9a:23:87', 'eth0', 'hv_netvsc', '0x3']]
2021-07-19 11:22:39,332 - handlers.py[DEBUG]: start: init-network/setup-datasource: setting up datasource
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/setup: setup
2021-07-19 11:22:39,333 - DataSourceAzure.py[DEBUG]: negotiating for 932F400A-9A3C-9B49-8F5D-EB1D67E7EDEE (new_instance=False)
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/_negotiate: _negotiate
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/bounce_network_with_azure_hostname: bounce_network_with_azure_hostname
2021-07-19 11:22:39,333 - DataSourceAzure.py[DEBUG]: Hostname in metadata is P105-Prod-GothiaPOC-Calibrate
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/temporary_hostname: temporary_hostname
2021-07-19 11:22:39,334 - handlers.py[DEBUG]: finish: azure-ds/temporary_hostname: SUCCESS: temporary_hostname
2021-07-19 11:22:39,334 - util.py[DEBUG]: Running command ('hostname',) with allowed return codes [0] (shell=False, capture=True)
2021-07-19 11:22:39,342 - util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'P105-Prod-GothiaPOC-Calibrate'] with allowed return codes [0] (shell=False, capture=True)
2021-07-19 11:22:39,391 - handlers.py[DEBUG]: start: azure-ds/perform_hostname_bounce: perform_hostname_bounce
2021-07-19 11:22:39,391 - util.py[DEBUG]: Reading from /etc/os-release (quiet=False)
2021-07-19 11:22:39,393 - util.py[DEBUG]: Read 393 bytes from /etc/os-release
2021-07-19 11:22:39,394 - DataSourceAzure.py[DEBUG]: pubhname: publishing hostname [hostname=P105-Prod-GothiaPOC-Calibrate policy=True interface=eth0]
2021-07-19 11:22:39,394 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-07-19 11:22:39,394 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2021-07-19 11:22:39,394 - util.py[DEBUG]: Running command ['sh', '-xc', 'i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x'] with allowed return codes [0] (shell=False, capture=False)
2021-07-19 11:22:40,212 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-07-19 11:22:40,213 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2021-07-19 11:22:40,213 - util.py[DEBUG]: publishing hostname took 0.818 seconds (0.82)
2021-07-19 11:22:40,213 - handlers.py[DEBUG]: finish: azure-ds/perform_hostname_bounce: SUCCESS: perform_hostname_bounce
2021-07-19 11:22:40,213 - util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'localhost.localdomain'] with allowed return codes [0] (shell=False, capture=True)
2021-07-19 11:22:40,256 - handlers.py[DEBUG]: finish: azure-ds/bounce_network_with_azure_hostname: SUCCESS: bounce_network_with_azure_hostname
2021-07-19 11:22:40,257 - DataSourceAzure.py[DEBUG]: negotiating with fabric via agent command builtin
The text was updated successfully, but these errors were encountered:
We have the following scenario: we are deprovisioning an image deployed from the Portal and use it to create a new virtual machine that has the same hostname as the original one. Once it is deployed, the hostname of the virtual machine is changed to localhost, instead of the name that we have set in the Portal, which is the name of the original VM.
Here are more details:
Distro and WALinuxAgent details (please complete the following information):
Additional context
I see a similar bug opened in 2018 that has been closed:
Ubuntu 18.04 --deprovision causes host name to become localhost · Issue #1398 · Azure/WALinuxAgent (github.com)
The workaround of adding the hostname manually in /etc/hostname works but we would not have to do that.
Log file attached$i || x=$ ?; ifup $i || x=$ ?; exit $x'] with allowed return codes [0] (shell=False, capture=False)
Here is a copy of the cloud.init file showing the name being changed:
2021-07-19 11:22:39,332 - init.py[DEBUG]: no work necessary for renaming of [[u'00:22:48:9a:23:87', 'eth0', 'hv_netvsc', '0x3']]
2021-07-19 11:22:39,332 - handlers.py[DEBUG]: start: init-network/setup-datasource: setting up datasource
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/setup: setup
2021-07-19 11:22:39,333 - DataSourceAzure.py[DEBUG]: negotiating for 932F400A-9A3C-9B49-8F5D-EB1D67E7EDEE (new_instance=False)
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/_negotiate: _negotiate
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/bounce_network_with_azure_hostname: bounce_network_with_azure_hostname
2021-07-19 11:22:39,333 - DataSourceAzure.py[DEBUG]: Hostname in metadata is P105-Prod-GothiaPOC-Calibrate
2021-07-19 11:22:39,333 - handlers.py[DEBUG]: start: azure-ds/temporary_hostname: temporary_hostname
2021-07-19 11:22:39,334 - handlers.py[DEBUG]: finish: azure-ds/temporary_hostname: SUCCESS: temporary_hostname
2021-07-19 11:22:39,334 - util.py[DEBUG]: Running command ('hostname',) with allowed return codes [0] (shell=False, capture=True)
2021-07-19 11:22:39,342 - util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'P105-Prod-GothiaPOC-Calibrate'] with allowed return codes [0] (shell=False, capture=True)
2021-07-19 11:22:39,391 - handlers.py[DEBUG]: start: azure-ds/perform_hostname_bounce: perform_hostname_bounce
2021-07-19 11:22:39,391 - util.py[DEBUG]: Reading from /etc/os-release (quiet=False)
2021-07-19 11:22:39,393 - util.py[DEBUG]: Read 393 bytes from /etc/os-release
2021-07-19 11:22:39,394 - DataSourceAzure.py[DEBUG]: pubhname: publishing hostname [hostname=P105-Prod-GothiaPOC-Calibrate policy=True interface=eth0]
2021-07-19 11:22:39,394 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-07-19 11:22:39,394 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2021-07-19 11:22:39,394 - util.py[DEBUG]: Running command ['sh', '-xc', 'i=$interface; x=0; ifdown
2021-07-19 11:22:40,212 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2021-07-19 11:22:40,213 - util.py[DEBUG]: Read 12 bytes from /proc/uptime
2021-07-19 11:22:40,213 - util.py[DEBUG]: publishing hostname took 0.818 seconds (0.82)
2021-07-19 11:22:40,213 - handlers.py[DEBUG]: finish: azure-ds/perform_hostname_bounce: SUCCESS: perform_hostname_bounce
2021-07-19 11:22:40,213 - util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'localhost.localdomain'] with allowed return codes [0] (shell=False, capture=True)
2021-07-19 11:22:40,256 - handlers.py[DEBUG]: finish: azure-ds/bounce_network_with_azure_hostname: SUCCESS: bounce_network_with_azure_hostname
2021-07-19 11:22:40,257 - DataSourceAzure.py[DEBUG]: negotiating with fabric via agent command builtin
The text was updated successfully, but these errors were encountered: