Monthly Archives: May 2014

Automatize OpenStack deployments with TryStack

Last few days I was trying TryStack and I’ve created a simple script in order to automatize my test deployments, feel free to use it.

First of all at least we need to install neutron and nova clients, for example, via pip:

pip install python-novaclient
pip install python-neutronclient

And then just run a script like this one:

export OS_USERNAME=<id>
export OS_PASSWORD=<pwd>
export OS_TENANT_NAME=<tname>
export OS_AUTH_URL=
neutron net-create net1
neutron subnet-create net1 <x.x.x.0/24> --name subnet1
neutron router-create router1
neutron router-gateway-set router1 external
neutron router-interface-add router1 subnet1
nova keypair-add --pub-key <path/> key1
nova secgroup-create sg sg
nova secgroup-add-rule sg icmp -1 -1
nova secgroup-add-rule sg tcp 1 65535
nova secgroup-add-rule sg udp 1 65535
nova secgroup-add-rule sg tcp 22 22
nova boot vm1 --flavor m1.medium --image "Fedora 20 x86_64" --key-name key1 --security-groups sg
nova boot vm2 --flavor m1.medium --image "Fedora 20 x86_64" --key-name key1 --security-groups sg
nova boot vm3 --flavor m1.medium --image "Fedora 20 x86_64" --key-name key1 --security-groups sg
neutron floatingip-create external
neutron floatingip-create external
neutron floatingip-create external
neutron floatingip-create external
nova floating-ip-list
nova floating-ip-associate vm1 <fip>
nova floating-ip-associate vm2 <fip>
nova floating-ip-associate vm3 <fip>

Just take into account to replace your personal information and to choose your private network and finally to assign your personal floating ip to the VMS.

Also my security group is quite redundant but I wanted to play around with the API.

For further reference here’s the API URLs:

* Compute
* Network
* S3
* Image
* Metering
* Cloudformation
* Volume
* EC2
* Orchestration
* Object Store
* Identity

Nested RHEV-H 3.x and VMware ESXi 5.5

I was trying to setup a RHEV laboratory in my ESXi but I wasn’t unable to approve my host.

In RHEVM appeared an error in the GUI like this one (check your Events tab):

Command returned failure code 1 during SSH session '[email protected]'

But in RHEVM logs there was another latent issue, checking /var/log/ovirt-engine/engine.log :

2014-04-27 12:17:20,814 ERROR [org.ovirt.engine.core.bll.InstallerMessages] (VdsDeploy) Installation x.x.x.x: Failed to execute stage 'Setup validation': Hardware does not support virtualization
2014-04-27 12:18:48,555 ERROR [org.ovirt.engine.core.bll.InstallVdsCommand] (pool-4-thread-49) [1c11a8d3] Host installation failed for host 4eba0c68-4370-4223-8271-831cccf3a64e, x.x.x.x.: Command returned failure code 1 during SSH session '[email protected]'

So in order to enables nested virtualization of RHEV-H in VMware ESXi 5.5u1 we have to add 2 new values in our vmx file:

featMask.vm.hv.capable = "Min:1"
vhv.enable = "TRUE"

After adding them I was able to approve the host without any further issues.

Full backup with Duplicity and DropBox

Some days ago I needed a dirty full backup of a VM, a nice solution that I’ve found out is to install duplicity and back it up via DropBox.

In order to do that first we need to install duplicity and DropBox Python SDK vi pip:

apt-get install -y python-pip duplicity
pip install dropbox
duplicity full / dpbx:///test --exclude=/sys --exclude=/dev --exclude=/proc --exclude=/run

A few notes to take into account:

* We need to approve duplicity via DropBox, an oAuth link will prompted during execution.

* If it doesn’t work and “NameError: global name ‘rest’ is not defined” shows up, please apply this patch.

* If test path is not found and this error show ups: “ErrorResponse: [404] u”Path ‘/test’ not found”
It means that you have to create a test directory in Dropbox inside /Apps/duplicity path, otherwise duplicity won’t find where to store our data.