Comments (10)
More digging has revealed that this happens to me when the hostname of the instance is the same as the hostname used in building the image. It's because the the waagent process doesn't reset the set-hostname file when deprovisioning. This results in setting the hostname being skipped in cc_set_hostname.py during cloud-init:
I'm going to open a bug to request that waagent removes or updates /var/lib/cloud/data/set-hostname on deprovision. As a workaround I manually rm
the file as the last step in my packer script.
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0",
"rm /var/lib/cloud/data/set-hostname || echo 'no set-hostname file'",
"sync; sync; sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}
from walinuxagent.
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.
from walinuxagent.
We are using cloud-init.x86_64 0:0.7.5-10.el7.centos.1
. Sorry maybe i was misunderstood, i pasted the full log of the waagent. Our problem is not around the SharedConfig.xml, but in the Ovf XML processing. On the rigth node i see:
2015/10/28 13:01:16 Provisioning image using OVF settings in the DVD.
...
2015/10/28 13:01:20 EnvMonitor: Detected host name change: localhost.localdomain -> vmslave12
2015/10/28 13:01:20 Setting host name: vmslave12
2015/10/28 13:01:21 Ovf XML process finished
but on the failed:
2015/10/28 13:00:53 Provisioning image using OVF settings in the DVD.
2015/10/28 13:00:53 Wrote /var/lib/waagent/CustomData
2015/10/28 13:00:53 Disabled SSH password-based authentication methods.
2015/10/28 13:00:55 Created user account: asd
2015/10/28 13:00:55 Deploy public key:750A...
2015/10/28 13:00:55 Ovf XML process finished
So there are missing Detected host name change
and Setting host name
lines.
Update: Is it true, that waagent is just reacting to the hostname change which caused by cloud-init and publishing new hostname to Azure services?
from walinuxagent.
Sorry. I may mislead you in the preview post. Your problem is that Network Manager is conflict with waagent. I assume you are using a customized image. You need to uninstall the Network Manager first.
from walinuxagent.
Thank you, we would try it, but really hard to catch the problem, because for example yesterday i created almost 40 instances without any problem.
from walinuxagent.
We are running on Centos7, and i found the text below in the official documentation:
Preparing a CentOS 7 virtual machine for Azure is very similar to CentOS 6, however there are several important differences worth noting:
The NetworkManager package no longer conflicts with the Azure Linux agent. This package is installed by default and we recommend that it is not removed.
from walinuxagent.
Right, NetworkManager is required in CentOS 7. The issue here is probably with cloud-init. Canonical wrote the cloud-init data provider for Azure, but it's really only been tested on Ubuntu. If you just install cloud-init it will work partially and probably try to provision the VM at the same time as the Azure Linux agent, which will probably be very racy and lead to odd issues like this. So in this case I would recommend removing cloud-init.
from walinuxagent.
Thank you.
from walinuxagent.
I think this is still an issue, at least for custom images. I'm using an Ubuntu 18.04 image created and provisioned by packer. After installing my software waagent is called with -deprovision+user
.
The first machine deployed from this image in a new VNET will register with DHCP using localhost
. The default config for provision.MonitorHostName in ubuntu is no
so even if the hostname is changed in cloud-init or via some other mechanism the DHCP wont get updated (not unless the lease is renewed).
Subsequent hosts will get the hostname they were given through the ARM template, presumably because DHCP rejects the attempt to register localhost, and gives them the name configured for them in the Azure.
I'm guessing the issue is caused by the set_dhcp_hostname
function being called during the packer build
There should be an unset_dhcp_hostname()
called during -deprovision
from walinuxagent.
Actually send host-name gethostname();
is in the original dhclient.conf, so waagent isn't adding it, it would have hardcoded the hostname if it had anyway.
For me, removing the send_hostname line from dhclient in my packer script stops localhost getting added to DNS, and modifying setting Provisioning.MonitorHostName=y
in waagent.conf adds the hostname I set in cloud-init.
from walinuxagent.
Related Issues (20)
- [FR] Best practice for packaging the WALinuxAgent for Nix/NixOS HOT 4
- [BUG] Installation fails on unendorsed distribution HOT 3
- Deprecation of distutils HOT 1
- Tried to create VMs in azure Across availability zone and got this error: No python interpreter found HOT 4
- [BUG] waagent missing ipv6.addr-gen-mode eui64 from nmcli command HOT 1
- [BUG] DNS issue where deprovisioning sets the hostname to localhost.localdomain HOT 1
- Running collect-logs HOT 2
- Log collection: Memory limit HOT 1
- [BUG] CPU credits drain on B1ls after update to 2.10.0.3 HOT 16
- Issue with extensions when Lib.Dir is modifiend in /etc/waagent.conf HOT 6
- How to disable Azure Portal to automatically install OmsAgentForLinux on my VM? HOT 2
- [BUG] the agent go offline randomly. ERROR ExtHandler ExtHandler Error fetching the goal state in waagent.log HOT 1
- [BUG] WALinuxAgent not updating to latest on Ubuntu HOT 3
- [BUG] VMAccess does not work for FreeBSD HOT 1
- [BUG] Ubuntu versions >= 18.04 checking for dhclient lease files
- [BUG] Flatcar Linux 3602.2.1 Boot Errors HOT 2
- [BUG] udev path mappings for data disks broken in Rocky Linux 9.1 image HOT 2
- [BUG] OpenBSD Deployment Failed HOT 1
- [BUG] Ubuntu22: MonitorHostname does not update iDNS
- [BUG] Ubuntu 2204 & Azure Linux v2: v2.9.1.1 fails to assign IP address for IB interface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from walinuxagent.