nsidc / vagrant-vsphere

VMware vSphere provider for Vagrant
Other
608 stars 166 forks source link

Vagrantfile to manage existing VMs #291

Open Hi-Angel opened 4 years ago

Hi-Angel commented 4 years ago

I have a vSphere with pre-existing VMs that I want to manage with Vagrant.

However when I use a Vagrantfile from README, vagrant tries to create a new VM instead. The reason is that README requires to put in the file either this:

# this means clone a VM
vsphere.clone_from_vm = true

…or this:

# this means create a VM from a template
vsphere.compute_resource_name = 'YOUR COMPUTE RESOURCE'
vsphere.resource_pool_name = 'YOUR RESOURCE POOL'

…but I don't want a new VM, I want to run existing ones. In fact, I can't even clone some VMs, because I get a complaint

$ vagrant up --provider=vsphere
Bringing machine 'default' up with 'vsphere' provider...
==> default: Calling vSphere CloneVM with the following settings:
==> default:  -- Source VM: Datacenter/vm/my_node1
==> default:  -- Target VM: Datacenter/vm/my_node1
SnapshotIncompatibleDeviceInVm: Virtual machine is configured to use a device that prevents the snapshot operation: Device '' is a SCSI controller engaged in bus-sharing.

So, what options do I need to NOT clone/create a VM, but rather to run an existing one?

edmcman commented 4 years ago

I think you'd have to modify the source to do this.