This playbook aims to deploy a SpinalStack platform on a libvirt hypervisor.
On a vanilla EL7 platform the following packages are necessary:
- genisoimage
- ansible
- libvirt-python
- qemu-kvm
Note: For qemu-kvm to be in the right path for ansible execution run ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-kvm
On a Fedora 21 platform, you need the same packages and to remove firewalld::
sudo service iptables save
sudo systemctl disable firewalld
sudo systemctl enable iptables
sudo systemctl stop firewalld
sudo systemctl start iptables
yum remove firewalld
The tool is know to work on Debian 7 too. In this case, you will need some packages from wheezy-backports (qemu and libvirt-bin). You will also need to install the python-paramiko package by yourself.
Make sure the ntp daemon is running on the host machine as the guests will take time from it
For ansible-spinalstack to work one needs to retrieve two eDeploy images. The install-server and openstack-full roles.
Currently, there is an issue with the qcow2 images so one should retrieve the raw image and convert it to a qcow2 image.
qemu-img convert -f raw -o qcow2 myimage.img myimage.qcow2
You need also a SSH key. We expect the public key to be in the standard ~/.ssh/id_rsa.pub
file.
The prepare.sh
will build qcow2 images on top of the base images. It will also create the seed.iso
disk to inject information through cloud-init.
The clean.sh
will destroy and undefine libvirt domains and network. It will also clean the filesystem from previous seed and edeploy images.
Simply run the following to be up and running :
$ ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts -c paramiko site.yml
New virtual machines will be created and ~/.ssh/known_hosts
will be outdate.
ANSIBLE_HOST_KEY_CHECKING=False
disable ssh known host check.
We also strongly recommend the use of paramiko.
- Templatize the libvirt xml description domain file
- Create a wrapper that would handler any architecture (ie. an n number of openstackfull images)