← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1455134] [NEW] User data configuration such as runcmd or write_files not working when using NoCloud datasource

 

Public bug reported:

When using NoCloud as data source in an Ubuntu VM, some cloud config
commands work properly (setting password and hostname), while others do
not work properly.

I have installed cloud-init in an Ubuntu VM (14.04)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

I have run 'dpkg-reconfigure cloud-init' and set the NoCloud as the only
datasource.

Then I have created meta-data and user-data:
meta-data:
local-hostname: test5
network-interfaces: |
  auto eth1
  iface eth1 inet static
    address 10.250.1.5
    netmask 255.255.255.0

user-data:
#cloud-config
hostname: test5
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
runcmd:
 - [ sh, -xc, "echo $(date) ': hello world!' >/home/ubuntu/fichero.txt" ]
write_files:
 - encoding: b64
   content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4...
   owner: ubuntu:ubuntu
   path: /home/ubuntu/kk
   permissions: ’0644’
 - content: |
   # My new /etc/sysconfig/samba file
   SMBDOPTIONS="-D"
   path: /home/ubuntu/samba

I have created a disk with:
truncate --size 2M init.img
mkfs.vfat -n cidata init.img
mcopy -oi init.img user-data meta-data ::

I have shut the VM down, attached the disk and then I have started the
VM again. The VM changes the name, the password and the interfaces
according to meta-data and user-data, but the configuration under runcmd
and write_files files has not been applied. I have noticed that the
information is available in the VM.

The same happens if I create a mime-multipart file with boothooks and
user-scripts.

Any suggestions?

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1455134

Title:
  User data configuration such as runcmd or write_files not working when
  using NoCloud datasource

Status in Init scripts for use on cloud images:
  New

Bug description:
  When using NoCloud as data source in an Ubuntu VM, some cloud config
  commands work properly (setting password and hostname), while others
  do not work properly.

  I have installed cloud-init in an Ubuntu VM (14.04)
  $ lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 14.04.1 LTS
  Release:        14.04
  Codename:       trusty

  I have run 'dpkg-reconfigure cloud-init' and set the NoCloud as the
  only datasource.

  Then I have created meta-data and user-data:
  meta-data:
  local-hostname: test5
  network-interfaces: |
    auto eth1
    iface eth1 inet static
      address 10.250.1.5
      netmask 255.255.255.0

  user-data:
  #cloud-config
  hostname: test5
  password: passw0rd
  chpasswd: { expire: False }
  ssh_pwauth: True
  runcmd:
   - [ sh, -xc, "echo $(date) ': hello world!' >/home/ubuntu/fichero.txt" ]
  write_files:
   - encoding: b64
     content: CiMgVGhpcyBmaWxlIGNvbnRyb2xzIHRoZSBzdGF0ZSBvZiBTRUxpbnV4...
     owner: ubuntu:ubuntu
     path: /home/ubuntu/kk
     permissions: ’0644’
   - content: |
     # My new /etc/sysconfig/samba file
     SMBDOPTIONS="-D"
     path: /home/ubuntu/samba

  I have created a disk with:
  truncate --size 2M init.img
  mkfs.vfat -n cidata init.img
  mcopy -oi init.img user-data meta-data ::

  I have shut the VM down, attached the disk and then I have started the
  VM again. The VM changes the name, the password and the interfaces
  according to meta-data and user-data, but the configuration under
  runcmd and write_files files has not been applied. I have noticed that
  the information is available in the VM.

  The same happens if I create a mime-multipart file with boothooks and
  user-scripts.

  Any suggestions?

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1455134/+subscriptions


Follow ups

References