Comment 7 for bug 1684869

Revision history for this message
Chad Smith (chad.smith) wrote :

Validated yakkety and zesty:
$ raw=yakkety-server-cloudimg-amd64.raw
$ yakkety-server-cloudimg-amd64.raw
yakkety-server-cloudimg-amd64.raw: command not found
$ sfdisk --part-uuid $raw 1
F9E1FDF2-234A-4732-AEF8-A75B86313FAD
$ ptuuid=$(sfdisk --part-uuid $raw 1)
$ ptuuid=$(echo "$ptuuid" | tr '[a-z]' '[A-Z]')
$ echo $ptuuid
F9E1FDF2-234A-4732-AEF8-A75B86313FAD
$ printf "%s\n%s\n%s\n%s\n" "#cloud-config" "password: passw0rd" \
> "chpasswd: {expire: False}" "ssh_pwauth: True" > my-user-data
$ echo "instance-id: $(uuidgen || echo i-abcdefg)" > my-meta-datacsmith@fringe:~$ cloud-localds my-seed.img my-user-data my-meta-data
$ sudo mount-image-callback $raw -- mchroot sh -xc 'cat /boot/vmlinu?-*' > kernel
[sudo] password for csmith:
+ cat /boot/vmlinuz-4.8.0-51-generic
$ qemu-img create -f qcow2 -b $raw disk.img 10G
Formatting 'disk.img', fmt=qcow2 size=10737418240 backing_file=yakkety-server-cloudimg-amd64.raw encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/root 2.0G 1011M 984M 51% /

$ dpkg -l cloud-init
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii cloud-init 0.7.9-90-g61 all Init scripts for cloud instances
ubuntu@ubuntu:~$ grep VERSION= /etc/os-release
VERSION="16.10 (Yakkety Yak)"

$ raw=zesty-server-cloudimg-amd64.raw
$ sfdisk --part-uuid $raw 149750BCB-3B61-4F13-92D4-D3153E9C28C6
$ ptuuid=$(sfdisk --part-uuid $raw 1)csmith@fringe:~$ ptuuid=$(echo "$ptuuid" | tr '[a-z]' '[A-Z]')
$ printf "%s\n%s\n%s\n%s\n" "#cloud-config" "password: passw0rd" \
> "chpasswd: {expire: False}" "ssh_pwauth: True" > my-user-data
$ echo "instance-id: $(uuidgen || echo i-abcdefg)" > my-meta-datacsmith@fringe:~$ cloud-localds my-seed.img my-user-data my-meta-data
$ sudo mount-image-callback $raw -- mchroot sh -xc 'cat /boot/vmlinu?-*' > kernel
[sudo] password for csmith:
+ cat /boot/vmlinuz-4.10.0-20-generic
$ qemu-img create -f qcow2 -b $raw disk.img 10G
Formatting 'disk.img', fmt=qcow2 size=10737418240 backing_file=zesty-server-cloudimg-amd64.raw encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
$ qemu-system-x86_64 -enable-kvm \
> -drive file=disk.img,if=ide,index=0 -drive file=my-seed.img,if=ide \
> -net nic -net user,hostfwd=tcp::2222-:22 \
> -snapshot -m 768 -nographic -echr 0x05 \
> -kernel kernel \
> -append "root=PARTUUID=${ptuuid} ro console=tty1 console=ttyS0"
# login ubuntu/passw0rd

ubuntu@ubuntu:~$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/root 2.0G 988M 1007M 50% /