summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2012-11-13 21:56:59 +0100
committervarac <varacanero@zeromail.org>2012-11-13 21:56:59 +0100
commitfebc1c5eb3af81c54aa19227c6fff709ca39e325 (patch)
treeb455e58ac0f9d51556c7906622c7f71780eb2659
parent07b4f696d966e5f5073181a2b16800fb093447ae (diff)
moved documentation from crabgrass to here
-rw-r--r--README.md76
1 files changed, 76 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..80467bb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,76 @@
+=====================
+Leap Cloudadmin Tools
+=====================
+
+Tools to clone a new kvm instance from an existing baseimage
+
+
+Outline
+=======
+
+Cloning Images will take these steps:
+
+* Clone Disk and xml-config from (inactive) Domain leap-baseimage-wheezy, using virt-clone
+* Use sfdisk to grow the root partition.
+* Create second disk (vfat-formatted), put the files meta-data and user-data on it
+* Start new Domain and attach second disk to it
+* Cloud-init will start at the end of the boot process, find the disk containing userdata, and configure the Domain:
+** set up timezone
+** setting a default locale
+** setting hostname
+** editing /etc/hosts for fqdn
+** sets root password
+** generate ssh host keys
+** adding ssh keys to /root.ssh/authorized_keys so they can log in
+** apt-get update/upgrade
+
+Setup (once)
+============
+
+* We need util-linux from wheezy, because of the "sfdisk-feature":
+ https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/686124 which lets us script the growing of the root partition.
+
+ apt-get install dosfstools mtools
+ apt-get install -t wheezy util-linux
+ echo "mtools_skip_check=1">~/.mtoolsrc
+ mkdir /var/lib/libvirt/cloudinit
+ chown libvirt-qemu /var/lib/libvirt/cloudinit
+
+Clone Instance
+==============
+
+* edit /etc/cloudinit/NAME.cfg, using vmtest.cfg.example from this repository as template
+* create new VM:
+
+ /usr/local/bin/create-guest-with-cloudinit -s 7 NAME
+
+* see /var/log/cloud-init.log on guest for information on cloudinit run
+
+
+Modify Userdata later, if needed
+================================
+
+ mount -o loop /var/lib/libvirt/cloudinit/cloudinit-test-user-data.img /mnt
+
+
+Configure new guest
+===================
+
+Networking
+----------
+
+* By default, eth0 uses NATed networking through the host virbr0. It gets an dynamic IP throught dhcp, and can access the internet through that.
+* To assign a static IP, add according entry to /etc/network/interfaces, i.e.:
+
+
+ allow-hotplug eth1
+ iface eth1 inet static
+ address 94.103.43.9
+ netmask 255.255.255.0
+ network 94.103.43.0
+ broadcast 94.103.43.255
+ gateway 94.103.43.1
+ # dns-* options are implemented by the resolvconf package, if installed
+ dns-nameservers 8.8.8.8 8.8.4.4
+ dns-search leap.se
+