← Back to team overview

cloud-init team mailing list archive

Cannot make extended cloud image to execute cloud-init successfully

 

Hi everybody,

I am trying to extend the current cloud image for ubuntu with some software and then snapshot it again, so that I can instantiate VMs out of that. I am using cloud-init to configure that first VM and all goes ok, but when then packer snapshots it and I create a new VM (which also uses cloud-init) out of that base image... I have verified that the files make their way into the new VM, but for some reason they do not seem to be executed: I do not have network, and the user I am trying to create is not there (although the users created when using cloud-init on the base image are there).

The last step before snapshotting the VM is to execute

cloud-init clean --logs --machine-id --configs all

And this is the content of the config files I use on the instantiation of the extended VMs

=== content of user-data =======
#cloud-config
disable_root: true
ssh_pwauth: false

users:
- name: myuser
  shell: /bin/bash
  ssh_authorized_keys:
   - ssh-ed25519 AAAAC3Nz....

package_update: true
package_upgrade: true
package_reboot_if_required: false

growpart:
  mode: auto
  devices: ["/"]
  ignore_growroot_disabled: false

=== content of network-config ======
version: 2
ethernets:
  enp1s0:
    dhcp4: yes

Does anybody know what might be going on, here?

Thank you very much!

--
Felix Rubio