Welcome to the Free Software contributions diary of Loïc Dachary. Although the posts look like blog entries, they really are technical reports about the work done during the day. They are meant to be used as a reference by co-developers and managers.

Migrating OpenVZ virtual machines to OpenStack

A OpenVZ cluster hosts GNU/Linux based virtual machines. The disk is extracted with rsync and uploaded to the glance OpenStack image service with glance add … disk_format=ami…. It is associated with a kernel image compatible with both OpenStack and the existing file system with glance update … kernel_id=0dfff976-1f55-4184-954c-a111f4a28eef ramdisk_id=aa87c84c-d3be-41d0-a272-0b4a85801a34 ….
Continue reading

Posted in Essex, openstack | Leave a comment

realistic puppet tests with jenkins and OpenStack (part 2/2)

The April infrastructure uses puppet manifests stored in a git repository. On each commit, a jenkins job is run and it performs realistic tests in a dedicated OpenStack tenant.

If the test is successfull, jenkins pushes the commit to the production branch. The production machines can then pull from it:

root@puppet:/srv/admins# git pull
Updating 5efbe80..cf59d69
Fast-forward
 .gitmodules                      |    6 +++
 jenkins/openstack-test.sh        |   53 +++++++++++++++++++++++++++
  jenkins/run-test-in-openstack.sh |  215 +++++++++++++++++++++++++++
 puppetmaster/manifests/site.pp   |   43 ++++++++++++++++++++--
 puppetmaster/modules/apt         |    1 +
 6 files changed, 315 insertions(+), 165 deletions(-)
 create mode 100755 jenkins/openstack-test.sh
 create mode 100644 jenkins/run-test-in-openstack.sh
 create mode 160000 puppetmaster/modules/apt
root@puppet:/srv/admins# git branch -v
  master     5efbe80 [behind 19] ajout du support nagios, configuration .... refs #1053
* production cf59d69 Set the nagios password for debugging ...

Continue reading

Posted in Essex, debian, openstack, puppet | Leave a comment

shared git repository over ssh

A git repository is configured to be shared between users from the same group with:

# grep group /srv/repos/git/l2mesh.git/config
        shared = group

The repository directory is set with the group sticky bit so that files created by a user have the same group and permissions as the directory:

root@redmine ~# ls -ld /srv/repos/git/l2mesh.git/config
-rw-rw-r-- 1 root git 82 Nov 23 13:09 /srv/repos/git/l2mesh.git/config

The repository can then be cloned with

git clone ssh://redmine.the.re/srv/repos/git/l2mesh.git

Continue reading

Posted in debian | Leave a comment

routing ipv6 from Hetzner to an OpenStack instance

The 2a01:4f8:162:12e3::2 IPv6 address is assigned to http://packaging-farm.dachary.org/ from the IPv6 subnet provided by Hetzner. The OpenStack host on which the instance running packaging-farm.dachary.org is running is configured as a proxy with

sysctl -w net.ipv6.conf.all.proxy_ndp=1
ip -6 neigh add proxy 2a01:4f8:162:12e3::2 dev eth0

and an OpenStack Essex bug is worked around by manually disabling hairpin_mode:

echo 0 > /sys/class/net/br2003/brif/vnet1/hairpin_mode

The page can then be retrieved with

$ curl --verbose -6 http://packaging-farm.dachary.org/
* About to connect() to packaging-farm.dachary.org port 80 (#0)
*   Trying 2a01:4f8:162:12e3::2...
* connected
* Connected to packaging-farm.dachary.org (2a01:4f8:162:12e3::2) port 80 (#0)
> Host: packaging-farm.dachary.org
> Accept: */*
>
...
<address>Apache/2.2.19 (Debian) Server at packaging-farm.dachary.org Port 80</address>
</body></html>
* Connection #0 to host packaging-farm.dachary.org left intact
* Closing connection #0

Continue reading

Posted in Essex, openstack | Leave a comment

realistic puppet tests with jenkins and OpenStack (part 1/2)

A git repository containing a puppet module is bound to a jenkins project. When the repository changes, jenkins boots a virgin puppetmaster OpenStack instance in a dedicated tenant. It runs the run-jenkins-test-in-openstack.sh script in the puppetmaster instance. In addition to the puppet unit tests, the script will launch realistic tests by launching OpenStack instances and checking their state. The checks are done with nagios which can also be used in a production environment to continuously monitor the deployment.
Continue reading

Posted in debian, jenkins, openstack, puppet | Leave a comment

creating a Debian GNU/Linux Wheezy puppet client for OpenStack

A Debian GNU/Linux wheezy image is booted and modified to set its hostname based on the content of the http://169.254.169.254/latest/meta-data/hostname metadata. The /etc/rc.local file is changed to run puppet agent –waitforcert 60 at boot time. The instance is then snapshoted and the corresponding file system reduced to a minimal size with resize2fs -M.
Continue reading

Posted in Essex, debian, openstack, puppet | Leave a comment

Configuring jenkins turnkeylinux on OpenStack

A turnkeylinux jenkins is installed to run tests related to the management of the the.re OpenStack cluster. It is configured to be used by registered users only from the web. An IRC bot is installed to allow interactions from the irc://irc.freenode.net#the.re chat room.

Continue reading

Posted in Essex, debian, jenkins, openstack, turnkeylinux | Leave a comment

Interactions with the kvm monitor in OpenStack

For debug purposes, is is convenient to access the kvm monitor to gain information about the state of the instance:

# python qmp-shell /var/lib/libvirt/qemu/instance-00000043.monitor
Connected!
(QEMU) query-commands
[{u'name': u'qom-list-types'}, {u'name': u'change-vnc-password'}, ...
(QEMU) query-vnc
{u'family': u'ipv4', u'service': u'5900', u'clients': [],
  u'enabled': True, u'auth': u'none', u'host': u'192.168.100.5'}
...

The libvirt daemon and the nova-compute daemon prevent access to the monitor and must be stopped.
Continue reading

Posted in Essex, debian, openstack | Leave a comment

Disaster recovery with kvm in OpenStack

A kvm process running an OpenStack instance with a volume attached to it becomes unresponsive. After manually investigating the cause of the problem, the kvm process is killed. The iscsi sessions is acknowledged to be lost and the disk is re-attached. The instance fails to reboot and the root file system is repaired from the compute node:

# qemu-nbd --port 20000 /var/lib/nova/instances/instance-00000103/disk &
# nbd-client localhost 20000 /dev/nbd0
Negotiation: ..size = 10240MB
bs=1024, sz=10737418240 bytes
# mount /dev/nbd0p1 /mnt
... fix things ...
# umount /mnt
# nbd-client -d /dev/nbd0

Continue reading

Posted in Essex, debian, openstack | Leave a comment

Debugging razor with OpenStack

razor can be used to deploy OpenStack. However, because it has been released mid 2012, debugging problems is often required. A razor virtual machine is created in an OpenStack cluster configured to allow network boot an OpenStack instance and nested virtual machines. When a new virtual machine instance is created in the same tenant as the razor machine, it gets a pixie boot from razor.
Testing and debugging razor can then be done within OpenStack and does not require dedicated hardware, as shown in the following screenshot of the VNC console of a virtual machine being deployed from razor ( it shows the razor microkernel booting ):

Continue reading

Posted in openstack, razor | Leave a comment