0

Ohai chefs. I'd like to provision VM's on KVM based hypervisor. However, chef provisioning does not have a driver for KVM. The closest one is Vargrant + libvirt. But I'm not sure how good of an idea is it for production. AFAIK Vagrant is used for the development and testing phases.

What are the options to provision KVM based Vm's with chef? Thanks in advance

  • https://github.com/chef/knife-kvm – tsturzl Nov 21 '15 at 18:10
  • I've looked into that before. It can be used for operations but I was looking for more of a way to do the provisioning and config in a recipe. – Pavel Jeloudovski Nov 21 '15 at 22:25
  • 1
    So you want to automate setting up KVM on a host, then manage provisioning VMs, and then control those VMs by state(running, stopped, restarting, etc)? – tsturzl Nov 22 '15 at 18:50

2 Answers2

0

The options are to write something yourself or use Terraform (or similar, but really the main other option is Terraform). You could jump directly to making a chef-provisioning driver, but that would be a lot of work to bit off. You could probably more easily make an LWRP based around virsh that is a bit more specific to your use case.

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • Thanks for the answer. I was thinking about a LWRP at first but thought maybe there is something ready that I couldn't find. I'm not familiar with Terraform, but it looks as if it does not have a provider for KVM. The list: [Terraform Providers](https://terraform.io/docs/providers/index.html). Looks like a VIRSH based LWRP is the way to go. I'll also ask chef if they have a provider for KVM in their roadmap. – Pavel Jeloudovski Nov 21 '15 at 22:28
0

You can use Packer with Chef as PROVISIONERS and QEMU as the BUILDERS

Raghav
  • 513
  • 3
  • 10