how I got cloud-init with cirros to work

847 views
Skip to first unread message

dvo...@redhat.com

unread,
Aug 10, 2017, 4:58:39 PM8/10/17
to kubevirt-dev

hey,

I was having trouble getting the 'nocloud' cloud-init data source working with cirros because the meta-data was not json parsable.  Here's a working example now.

1. Create user and meta data

cat << END > meta-data
{
"instance-id": "atomic-host001",
"local-hostname": "atomic01.example.org"
}
END


cat << END > user-data
#cloud-config
password: atomic
ssh_pwauth: True
chpasswd: { expire: False }
END

2. generate an iso with those two files
genisoimage -output cirros_nocloud.iso -volid cidata -joliet -rock user-data meta-data

3. attach that iso as a raw block device on the vm

After I formatted meta-data to be json, it all worked
Reply all
Reply to author
Forward
0 new messages