I am using Salt to provision machines, both physical and virtual, for my company. It would be really nice if I could also use Salt (Salt-Virt) to manage the various virtual machines running on my hosts, as the number/complexity of VMs is growing quickly.
Here's where I am:
- Followed this guide, changing packages for Ubuntu instead of RHL: http://docs.saltstack.com/en/latest/topics/tutorials/cloud_controller.html
- Both the physical and virtual machines are running Ubuntu Server
- I am able to run the
salt-run virt.init test1 2 512 salt://BASE.img
command to deploy the machine to the host. - The image is showing up on the minion in
/srv/salt-images/test1/
as a .qcow2
But it seems that the host (hypervisor) has no idea that the VM exists. I am not getting any errors from Salt on the master or the minion.
- On the host,
virsh list
brings back an empty list - On the Salt master,
salt-run virt.start test1
returns the error:Failed to find vm test1 to start
Has anyone ever gotten Salt-Virt to work on Ubuntu? What am I missing?
I found the solution. Here are the steps:
/srv/salt
/srv/salt/base.vdi
qemu-img -f vdi -O qcow2 base.vdi base.qcow2
br0
Cool. The machines should be ready to go now.
On the master, run
salt "*" virt.init <name_of_vm> <num_cores_for_vm> <mb_of_ram_for_vm> <path_to_image>
For me, this was
salt "*" virt.init test_vm 2 512 salt://base.qcow2
Machine should spin up on M2.
Test using
salt-run virt.query
on the salt master