Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Steps to create minimal CentOS 6 container template:

1.Create a directory where the template files will be created

...

8. centos-6-x86_64.tar.gz can be registered as a template in CloudStack

Creating template on Ubuntu

  1. Install lxc: apt-get install lxc

  2. Create  a container with any name, in our case 'ubuntu':
    sudo lxc-create --template=debian --name=ubuntu -- --release=wheezy 


  3. Creation of the LXC container will take a lot of time, it will be stored here: /var/lib/lxc/ubuntu


  4. Next stop the container:
    sudo lxc-stop -n ubuntu


  5. Next create a temp director, tar the rootfs and export the template:
    mkdir -p /tmp/lxc-template
    cd /tmp/lxc-template
    sudo tar --numeric-owner -czf /tmp/lxc-template/template.tar.gz /var/lib/lxc/ubuntu/rootfs/