Cloud-init

From UVOO Tech Wiki
Revision as of 00:30, 28 February 2019 by imported>Jeremy-busk
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Getting Started

https://docs.openstack.org/image-guide/create-images-manually.html

https://pcocc.readthedocs.io/en/latest/manpages/man7/cloudconfig-tutorial.html

Fedora/RHEL

https://www.projectatomic.io/docs/quickstart/

Debian

Buster

Ubuntu

Get image

wget https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img

Then create vm using this image.

cloud.txt

#cloud-config
password: Password1
chpasswd: { expire: False }
ssh_pwauth: True
hostname: proxy1

Create iso for existing vm

sudo cloud-localds /tmp/cloud-init-cd.iso cloud.txt

Mount cloud-init-cd.iso to cdrom in vm and boot.

Login with ubuntu:Password1

Sizing Image

qemu-img resize kvm1.qcow2 +20G
cp kvm1.qcow2 kvm1-orig.qcow2
virt-resize --expand /dev/sda1 kvm1-orig.qcow2 kvm1.qcow2

Issues

genisoimage and mkisofs not working with pass. Looking into.


Serial Port Needed

https://bugs.launchpad.net/cloud-images/+bug/1573095

You can remove

sudo sed -i 's/ console=ttyS0//g' /etc/default/grub.d/50-cloudimg-settings.cfg
sudo update-grub

However, we need ttyS0 for virsh console

https://help.ubuntu.com/community/KVM/Access

Getting Started

Resources