Created
August 17, 2012 21:01
-
-
Save smoser/3382629 to your computer and use it in GitHub Desktop.
boot cloud images with libvirt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ disk_dist_imgz=/archive/mirrors/uec/releases/precise/release-20120728/ubuntu-12.04-server-cloudimg-amd64-disk1.img | |
$ disk_dist_img=disk.img.dist | |
$ disk=disk.img | |
$ qemu-img convert "${disk_dist_imgz}" "${disk_dist_img}" | |
$ qemu-img create -f qcow2 -b "${disk_dist_img}" "$disk" | |
$ cat my-user-data | |
#cloud-config | |
password: passw0rd | |
chpasswd: { expire: False } | |
ssh_pwauth: True | |
ssh_authorized_keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAA...w== smoser@brickies | |
# update the above user-data with the output of 'ssh-add -L' | |
# create a seed disk with 'make-seed-disk' for cloud-init (LP: #1036312) | |
$ make-seed-disk --disk-format=qcow2 seed.img my-user-data | |
# write-libvirt-xml from http://paste.ubuntu.com/1153294/ | |
$ ./write-libvirt-xml "$disk,seed.img" my-dom > libvirt.xml | |
$ virsh define libvirt.xml | |
$ virsh start my-dom | |
# serial output should go to 'my-dom-serial.log' including ip address for ssh | |
$ virsh vncdisplay my-dom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://paste.ubuntu.com/1153294/ doesn't exist anymore.