Skip to content

Commit

Permalink
Add support for OpenStack clouds.
Browse files Browse the repository at this point in the history
  • Loading branch information
anaion committed May 8, 2014
1 parent e5653d4 commit 96565b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion conpaas-services/scripts/create_vm/create-img-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def error(error_msg):
error('Unknown hypervisor "%s".' % hypervisor)

cloud = config.get('CUSTOMIZABLE', 'cloud')
if cloud == 'opennebula':
if cloud == 'opennebula' or cloud == 'openstack':
pass
elif cloud == 'ec2':
if hypervisor != 'xen':
Expand Down
12 changes: 9 additions & 3 deletions conpaas-services/scripts/create_vm/scripts/003-create-image
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,21 @@ EOF

if [ "$CLOUD" == "opennebula" ] ; then
net_config="$opennebula_specific"
elif [ "$CLOUD" == "ec2" ] ; then
elif [ "$CLOUD" == "ec2" ] || [ "$CLOUD" == "openstack" ] ; then
net_config="$ec2_specific"
else
cecho 'Something went wrong. "CLOUD" shell variable is not properly defined.';
exit 1;
fi

#OpenStack defaults to the use of the virtio disk driver
BLOCK_DEV=/dev/sda1
if [ "$CLOUD" == "openstack" ] ; then

This comment has been minimized.

Copy link
@kavvv

kavvv May 8, 2014

this condition should check for the hypervisor to be KVM. If OpenStack on Xen also uses virtio, then the condition should check whether it is KVM OR Xen.

This comment has been minimized.

Copy link
@anaion

anaion May 8, 2014

Author Contributor

The disk driver is a libvirt setting, I don't think it is hypervisor dependent.

This comment has been minimized.

Copy link
@kavvv

kavvv May 8, 2014

I think QEMU developers disagree ;-)

This comment has been minimized.

Copy link
@anaion

anaion May 8, 2014

Author Contributor

Ok. I'll change it.

BLOCK_DEV=/dev/vda1
fi

cecho "Writing fstab"
echo "/dev/sda1 / ext3 defaults 0 1" > $ROOT_DIR/etc/fstab
echo "$BLOCK_DEV / ext3 defaults 0 1" > $ROOT_DIR/etc/fstab
cecho "Writing /etc/network/interfaces"
cat <<EOF > $ROOT_DIR/etc/network/interfaces
auto lo
Expand Down Expand Up @@ -167,7 +173,7 @@ set timeout=0
menuentry '$(basename $VMLINUZ)' {
insmod ext2
set root='(hd0,1)'
linux $VMLINUZ root=/dev/sda1
linux $VMLINUZ root=$BLOCK_DEV
initrd $INITRD
}
EOF
Expand Down

0 comments on commit 96565b9

Please sign in to comment.