Then, the complete steps are:
- Create qcow2 image
qemu-img create -f qcow2 foo.qcow2 2G
-
Boot whit the new disc install basic OS, in my case, I download debian 7.11 iso
-
Verify the repositories
deb http://cdn.debian.net/debian/ wheezy main non-free contrib
deb-src http://cdn.debian.net/debian/ wheezy main non-free contrib
deb http://ftp.debian.org/debian wheezy-backports main
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
- Upgrade you new system
apt-get -y update
apt-get -y upgrade
- Install one-context
wget --no-check-certificates https://github.com/OpenNebula/addon-context-linux/releases/download/v5.4.1/one-context_5.4.1-1.deb -O /tmp/oc.deb
dpkg -i /tmp/oc.deb
rm -f /tmp/oc.deb
- Resolve dependencies
apt-get -fy install
- Install cloud-initramfs-growroot
apt-get install cloud-initramfs-growroot
- Clean the apt cache
apt-get clean
- Shutdown the vm
shutdown -h now
- Reduce the disc size
qemu-img convert -O qcow2 -c foo.qcow2 bar.qcow2
- Copy to datastore server
scp bar.qcow2 oneadmin@server:/var/tmp
- Import the vm qcow2 disc as image
oneimage create --name "Debian 7" --path /var/tmp/bar.qcow2 --driver qcow2 --type OS --prefix vd --datastore default
- I do this by command line because sunstone can’t upload the image, why? I don’t know and don’t matter me XD
- Create the template using the new image, I make this from sunstone
- ???
- Enjoy your new instance