How can we reduce the number of servers required to deploy a small OpenStack Cloud?
OpenStack has a number of lighter weight services which don’t really make best use of anything other than the cheapest of cheap servers in this type of deployment; this includes the cinder, glance, keystone, nova-cloud-controller, swift-proxy, rabbitmq-server and mysql charms.
Ultimately Juju will solve the problem of service density in physical server deployments by natively supporting deployment of multiple charms onto the same physical servers; but in the interim I’ve hacked together a Juju charm, “virtme”, which can be deployed using Juju and MAAS to virtualize a physical server into a number of KVM instances which are also managed by MAAS.
Using this charm in conjunction with juju-jitsu allows you to make the most of a limited number of physical servers; I’ve been using this charm in a raring based Juju + MAAS environment:
juju bootstrap (mkdir -p raring; cd raring; bzr branch lp:~virtual-maasers/charms/precise/virtme/trunk virtme) jitsu deploy-to 0 --config config.yaml --repository . local:virtme
Some time later you should have an additional 7 servers registered into the MAAS controlling the environment ready for use. The virtme charm is deployed directly to the bootstrap node in the environment – so at this point the environment is using just one physical server.
The config.yaml file contains some general configuration for virtme:
virtme: maas-url: "http://<maas_hostname>/MAAS" maas-credentials: "<maas_token>" ports: "em2" vm-ports-per-net: 2 vm-memory: 4096 vm-cpus: 2 num-vms: 7 vm-disks: "10G 60G"
virtme uses OpenvSwitch to provide bridging between KVM instances and the physical network; right now this requires a dedicated port on the server to be cabled correctly – this is configured using ‘ports’. Each KVM instance will be configured with ‘vm-ports-per-net’ number of network ports on the OpenvSwitch bridge.
virtme also requires a URL and credentials for the MAAS cluster controller managing the environment; it uses this to register the details of the KVM instances it creates back into MAAS. Power control is supported using libvirt; virtme configures the libvirt daemon on the physical server to listen on the network and MAAS uses this to power control the KVM instances.
Right now the specification of the KVM instances is a little clunky – in the example above, virtme will create 7 instances with 2 vCPUS, 4096MB of memory and two disks, a root partition that is 10G and a secondary disk of 60G. I’d like to refactor this into something a little more rich to describe instances; maybe something like:
vms: small: - count: 7 - cpu: 2 - mem: 4096 - networks: [ eth1, eth2 ] - disks: [ 10G, 20G ]
Now that the environment has a number of smaller, virtualized instances, I can deploy some OpenStack services onto these units:
juju deploy keystone juju deploy mysql juju deploy glance juju deploy rabbitmq-server ....
leaving your bigger servers free to use for nova-compute:
juju deploy -n 6 --constraints="mem=96G" nova-compute
WARNING: right now libvirt is configured with no authentication or security on its network connection; this has obvious security implications! Future iterations of this charm will probably support SASL or SSH based security.
BOOTNOTE: virtme is still work-in-progress and is likely to change; if you find it useful let me know about what you like/hate!