frapposelli / vagrant-vcenter

A Vagrant provider for VMware vCenter®
MIT License
106 stars 36 forks source link

windows ovf template #25

Open lesaux opened 9 years ago

lesaux commented 9 years ago

Hello I'm having trouble with windows vmware_ovf templates.

I'm creating my own templates with packer. When I launch a vagrant box, the vmware_ovf template is uploaded to vcenter, the vm is created, but it isn't launched - I think the vm customization fails. I can manually launch the vm from vcenter just fine, but I notice network isn't configured as expected (dhcp lease instead of static ip, hostname isn't set etc...).

vagrant-rbvmomi-1.8.1/lib/rbvmomi/vim/Task.rb:11:in `wait_for_completion': InvalidArgument: A specified parameter was not correct. (RbVmomi::Fault)

I'm not sure if I'm doing something wrong in my packer template, or if it's the Vagrantfile.

Would you be kind enough to provide an example Vagrantfile to launch a windows box? Regards

edit: reading on other issues, my problem is more or less the same as https://github.com/gosddc/vagrant-vcenter/issues/17. I would like to add that I have no issues with centos and ubuntu gosddc boxes.

lbaldwin123 commented 9 years ago

I also have the same problem.

it's helpful to know that in my case once the vm is created, the guest_os_type/Guest Operating System = rhel6_64Guest \ Red hate Enterprise 6(64bit) is being correctly identified in the newly created vm. along with the vlan and other vm properties.

vladistan commented 9 years ago

The problem is caused by plugin not reading Vagrant config correctly. For some reason it always defaults to LinuxCustomization, that's why you get the error shown above.

Applying this patch fixes the problem.

--- a/lib/vagrant-vcenter/config.rb
+++ b/lib/vagrant-vcenter/config.rb
@@ -113,7 +113,6 @@ module VagrantPlugins
       attr_accessor :template_id

       def initialize
-        @prep_type = 'linux'
         @enable_vm_customization = true
       end

You will also need to put this line into all your Vagrantfiles that use this provider

vcenter.prep_type = "Windows"

tsugliani commented 9 years ago

Hi gents,

Thanks @vladistan for the patch, appreciated, and we do accept any PRs. (develop branch)

As you can probably imagine @frapposelli and myself are pretty busy on other stuff right now, so we can't really fix all the current issues. We will try to review the PRs, test & merge them as soon as possible.

Sorry about that.