Created
January 13, 2017 04:45
-
-
Save Dishwasha/ba75aebc448d6b56a3d9c15028aed363 to your computer and use it in GitHub Desktop.
Create custom qcow2 cloud images for OpenNebula
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/sh | |
qemu-img create -f qcow2 -b $1 modified.qcow2 | |
virt-customize -v --attach packages.iso --format qcow2 -a modified.qcow2 --run script.sh | |
qemu-img convert -O qcow2 modified.qcow2 final.qcow2 | |
TMPDIR=/tmp virt-sparsify final.qcow2 $2 | |
rm -f modified.qcow2 final.qcow2 |
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
mkdir /tmp/mount | |
mount LABEL=PACKAGES /tmp/mount | |
# Install opennebula context package | |
rpm -Uvh /tmp/mount/one-context*rpm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment