vagrant-vsphere icon indicating copy to clipboard operation
vagrant-vsphere copied to clipboard

Allow cloning of vm's without vCenter

Open jischebeck opened this issue 10 years ago • 11 comments

We are using vSphere Servers without a vCenter. After starting vagrant up, I get the following error: "the operation is not supported on the object".

Please add a feature to support cloning of VMs without vCenter, like it is described in: http://www.lucd.info/2013/06/30/hl-tools-part-1-clone-a-vm-without-vcenter/

As an alternative to updating the existing vmx-file, a template vmx-file could be defined as part of the vagrantfile or the box definition.

jischebeck avatar Jun 04 '14 13:06 jischebeck

Could you post the Vagrantfile you're using when you get this error?

marnovdm avatar Jul 07 '14 19:07 marnovdm

I get the error using the following Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = 'dummy'
  config.vm.box_url = './example_box/dummy.box'

  config.vm.provider :vsphere do |vsphere|
    vsphere.host = 'replaced'
    vsphere.data_center_name = 'ha-datacenter'
    vsphere.template_name = '_template_centos65_vagrant'
    vsphere.name = 'ji_centos'
    vsphere.user = '<user>'
    vsphere.password = '<password>'
    vsphere.insecure = 'true'
     vsphere.clone_from_vm = true
  end
end

jischebeck avatar Jul 13 '14 11:07 jischebeck

Is there anything planned for the future to support the free Version of ESXI?

regenrek avatar Nov 18 '14 20:11 regenrek

@regenrek, wondering the same

nitrocode avatar Nov 09 '15 20:11 nitrocode

The vagrant-vsphere plugin uses the vSphere API to clone VM's. The error that you are seeing, "NotSupported: The operation is not supported on the object.", is a response coming from ESXi telling you that the API call for CloneVM is not supported. This is a fairly essential operation for using vagrant to provision VM's and cannot easily be worked around by making changes to the vagrant-vsphere plugin.

jwbraucher avatar Nov 09 '15 22:11 jwbraucher

@jwbraucher

It's fairly easy to clone a VM using vmfkstools which is accessible by SSHing into the ESXi server. I use the following script for my servers to do a quick clone without vcenter.

https://gist.github.com/nitrocode/007fce26f161aa0b74ec

./clone.sh ORIGNAME CLONENAME

nitrocode avatar Nov 09 '15 23:11 nitrocode

@nitrocode

The vagrant-vsphere plugin only works with the vSphere API. It is unlikely that all of the same functionality could be provided by SSHing into an ESXi server and running shell commands. CloneVM is only one of many API calls needed for vagrant-sphere to function properly.

Even if it were possible to recreate the same functionality of vagrant-vsphere using SSH and shell commands this would amount to an entirely different vagrant plugin. There are no plans to take the vagrant-vsphere project in this direction.

jwbraucher avatar Nov 10 '15 00:11 jwbraucher

Guess this warrants a new plugin.

Thank you.

nitrocode avatar Nov 10 '15 14:11 nitrocode

@jwbraucher This plugin should work with at least within the trial period of 60 days of ESXi, right ?

vikas027 avatar Mar 12 '16 13:03 vikas027

Hmm. If you VMwareCeption an esxi box, it'll have a shiny new 60-day. I bet you could spin up a snapshotted esxi host as a host for the actual box building; then reel it back (to a powered-off state) when you're done.

bish0polis avatar Dec 25 '16 05:12 bish0polis

This plugin will not work with any form of standalone esxi. I tested it on a standalone host with an enterprise plus license and the feature is still not supported.

jtcressy avatar Jan 29 '17 03:01 jtcressy