Skip to content

Instantly share code, notes, and snippets.

@dubcl
Created March 9, 2018 16:13
Show Gist options
  • Save dubcl/b1b81bf1d052ecaf02fc6adecd3918ac to your computer and use it in GitHub Desktop.
Save dubcl/b1b81bf1d052ecaf02fc6adecd3918ac to your computer and use it in GitHub Desktop.
Create Debian 7 OpenNebula Image

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment