New Question

cloud-init seems stuck

asked 2015-09-03 12:26:25 +0300

NiclasEriksson gravatar image

updated 2015-09-03 20:29:24 +0300

During a deployment of a windows image it seems that the cloud-init part isn't finishing as it should. The config image is still mounted in the VM and the logfile cloudbase-init-unattend has the setting hostname line and then Deleting metadata folder c:\windows\temp*** as the last two rows. The password for admin isn't set either. Anyone that has some input on how to troubleshoot?

The cloud-init ver is 0.9.9.dev29 but I've also tried the stable one 0.9.8 but the same issue occur.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2015-09-03 16:04:30 +0300

NiclasEriksson gravatar image

I've managed to find out a bit more. Even if a set a admin password when launching the instance it creates a random one based on the keypair. I've managed to get it using nova get-password fine so that part is probably OK. But the config image is still mapped to the VM, shouldn't that be removed after cloud.init has finished?

edit flag offensive delete link more


The config_drive image is created/managed by OpenStack nova. Cloudbase-init just uses the information inside it and does not/cannot manage it.

ader1990 gravatar imageader1990 ( 2015-09-04 05:21:15 +0300 )edit

The admin password can be set by adding to the nova boot command "--meta admin_pass="MyStr@ngPass". When using the config drive metadata service, it is not possible to retrieve the password, unless http metadata is also enabled and used by cloudbase-init.

ader1990 gravatar imageader1990 ( 2015-09-04 05:23:57 +0300 )edit

answered 2015-09-04 09:45:34 +0300

updated 2015-09-04 09:51:36 +0300

Tested with 0.9.9.dev29 (beta) x64 on ws2008 and ws2012 (but it's working in the same manner with other versions/architectures) and the default behavior is the following:

Cloudbase-Init is installed and the image is sysprepared, which implies running the service with the unattend configuration file which will not allow it to reboot the computer or stop by itself and the only plugins that will be executed are the one responsible for MTU and the one that sets the host name. Also, the default metadata providers search order is configuration drive, then the http, so for sure it will use the drive (if available in the system). So, it's absolutely normal that the last two lines in the unattend log file to be the setting host name and the deleting metadata temporary folder, because it will not stop nor execute something other else until the computer is rebooted (by a special script that uses sysprep or manually by the user). After reboot, the service will execute normally (cloudbase-init.conf) and will iterate through all the plugins (inclusive the one that sets the password) and it takes the password found in the metadata (through the http service) and it updates it accordingly (using nova get-password with the used private key, shows the custom password).

As far as I know, the config image isn't unmounted automatically by the system or the service, so it'll be present at each boot. In short:

  1. Under a default devstack OpenStack deployment, the attached configuration drive and the http providers will be available until manual unmounting.
  2. With sysprep/unattend/first run, only the MTU and host name plugins will be executed.
  3. The password plugin (among others) will be executed within the first normal boot (if other plugins didn't request a reboot already).
edit flag offensive delete link more


Thanks for the input. I've managed to get the random password set by using nova get-password so it seems to work as normal. But it seems that even after a normal boot no more plugins are run. But maybe I haven't set the correctly. I'm using the HP CSA Foundation to trigger an instance.

NiclasEriksson gravatar imageNiclasEriksson ( 2015-09-06 12:04:00 +0300 )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

1 follower


Asked: 2015-09-03 12:26:25 +0300

Seen: 2,503 times

Last updated: Sep 04 '15