Last active
October 23, 2019 19:41
-
-
Save chiradeep/11388262 to your computer and use it in GitHub Desktop.
LXC script to initiate build of CloudStack LXC systemvm
This file contains 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
#!/bin/bash | |
# tested on Ubuntu 14.04 | |
#set -x | |
sudo lxc-create --template=debian --name=systemvm -- --release=wheezy | |
sudo lxc-start -n systemvm -d | |
sleep 2 | |
ip=$(sudo lxc-info -n systemvm -i | awk '{print $2}') | |
#start provisioning using ssh | |
ruby provision.rb $ip -u root -p root | |
# tar up the rootfs to create an lxc template | |
sudo lxc-stop -n systemvm | |
mkdir -p /tmp/lxc-systemvm | |
# Compress container's rootfs | |
sudo tar --numeric-owner -czf /tmp/lxc-systemvm/systemvm-rootfs.tar.gz /var/lib/lxc/systemvm/rootfs/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment