Azure – cloud-init error, No instance datasource found

azurecloud-init

I am trying to run a Ubuntu Linux VM from the custom VHD I prepared. I provision the VM but seems there is some issue with the Vm agent and cloud-init.

  • Host name/ DNS is not set on boot
  • Cloud-init log shows "No instance datasource found! Likely bad things
    to come!"
  • Portal shows Linux VM agent is not reachable but actually it is
    running.

Cloud-init log

2017-10-17 03:37:12,127 - util.py[DEBUG]: Attempting to remove /var/lib/cloud/instance 2017-10-17 03:37:12,132 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.ubuntu.Distro'> 2017-10-17 03:37:12,132 - __init__.py[DEBUG]: Looking for for data source in: ['Azure'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK'] 2017-10-17 03:37:12,191
- __init__.py[DEBUG]: Searching for network data source in: [] 2017-10-17 03:37:12,192 - util.py[WARNING]: No instance datasource found! Likely bad things to come! 2017-10-17 03:37:12,199 - util.py[DEBUG]: No instance datasource found! Likely bad things to come! Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 331, in main_init
    init.fetch(existing=existing)   File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 349, in fetch
    return self._get_data_source(existing=existing)   File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 259, in
_get_data_source
    pkg_list, self.reporter)   File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 333, in find_source
    raise DataSourceNotFoundException(msg) cloudinit.sources.DataSourceNotFoundException: Did not find any data source, searched classes: ()

Waagent log

2017/10/20 05:10:31.059647 INFO Waiting for cloud-init to copy ovf-env.xml to /var/lib/waagent/ovf-env.xml [2 retries remaining, sleeping 5s]
2017/10/20 05:10:31.109442 WARNING cloud-init does not appear to be running
2017/10/20 05:10:36.140473 ERROR Provisioning failed: [000004] Giving up, ovf-env.xml was not copied to /var/lib/waagent/ovf-env.xml after 1800s
2017/10/20 05:10:36.202700 INFO Detect protocol endpoints
2017/10/20 05:10:36.222987 INFO Clean protocol

Appreciate any help.

Thanks

RV

Best Answer

Changes the /etc/waagent.conf as

Provisioning.Enabled=n
ResourceDisk.Format=n

run command de-provision command

 # sudo waagent -deprovision

shut down the VM and capture the VM image and then create a new VM from the captured image

Related Topic