-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set IP using a customization spec #95
Comments
Just so I can stay sane reading it ;) : Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = 'dummy.box'
config.vm.provider :vsphere do |vsphere|
vsphere.host = '{vSphere host}'
vsphere.data_center_name = 'Datacenter'
vsphere.compute_resource_name = '{Cluster}
vsphere.template_name = 'Template 1'
vsphere.user = 'Vagrant'
vsphere.password = 'xxxxx'
vsphere.insecure = 'true'
vsphere.data_store_name = 'LUN 11'
vsphere.customization_spec_name = 'NE Template'
config.vm.network 'private_network', ip: '192.168.1.200'
end
end Does your customization spec have a network adapter configured? If not, it won't work. Also just a tip, you should not change the top level config.vm.provider :vsphere do |vsphere, override|
override.vm.network 'private_network', ip: '192.168.1.200'
end |
I can reproduce your problem when the specification is on DHCP mode and when you also provide an IP address. I'm struggling with the same issue. |
Anyone figured out how to setup an IP to a Linux box? |
I have the same issue. Any success ? |
What happens if you set the config.vm.network object inside the config block, like this: Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = 'dummy.box'
config.vm.network 'private_network', ip: '192.168.1.200'
config.vm.provider :vsphere do |vsphere|
vsphere.host = '{vSphere host}'
vsphere.data_center_name = 'Datacenter'
vsphere.compute_resource_name = '{Cluster}
vsphere.template_name = 'Template 1'
vsphere.user = 'Vagrant'
vsphere.password = 'xxxxx'
vsphere.insecure = 'true'
vsphere.data_store_name = 'LUN 11'
vsphere.customization_spec_name = 'NE Template'
end
end |
@dataplayer I see you point.
Now I understand this section in docs 👍
Thank you |
@dataplayer I added template with two NIC (dhcp and prompt user) and got the same issue:
|
I was able to get it to work. I set a static IP(just an unused address) in my vsphere customization spec, and then configured the ip in the Vagrant file as documented. After issuing the 'vagrant up' it set the new vm's IP to the one in the config and not the one in the customization spec. |
@Spots |
The following is my Vagrantfile: Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = 'dummy.box'
config.vm.provider :vsphere do |vsphere, override|
vsphere.host = 'my-vsphere-server-host'
vsphere.name = 'my-hostname'
# vsphere.data_center_name = 'Datacenter'
vsphere.compute_resource_name = 'FM&T Dev Cluster'
vsphere.template_name = 'Templates/t-centos66-vagrant'
vsphere.user = 'username'
vsphere.password = 'password'
vsphere.insecure = 'true'
vsphere.data_store_name = 'intopsz1_vmdk'
vsphere.customization_spec_name = 'centos66'
override.vm.network 'private_network', ip: '10.161.68.209'
end
end Just wondering what else could be going wrong. Is it absolutely necessary to use a ruby v1.9.3 or higher? I seem to be getting results even with the 1.8.7 enterprise ruby, but setting a static IP is the ever elusive holy grail. Apart from that, it matters not if I use "override.vm.network" or "config.vm.network", or if either of the above is in or out of the config bloc - the ip requested is never set, and there's always the "Vagrant::Errors::SSHNotReady" endless loop at the end (a separate issue I suppose). The IP that IS set however (but which still requires the removal of 70-persistent-net-rules and a reboot to activate properly) is the IP I have in BOTH the customisation specification AND the template I am using. This IP is 10.161.68.199 ... but the REQUIRED IP is that specified in the Vagrantfile, which is 10.161.68.209 as indicated above. Honestly I wouldn't even mind so much if it was necessary to rm the 70-persistent-net-rules file ONCE with a self-deleting bash script on the initial boot or whatever, as long as the static IP specified in the Vagrantfile got set on eth0. Can anyone see anything obviously wrong here? Thanks for any ideas, A./ |
override.vm.network 'private_network', ip: '10.161.68.209' shouldnt be in there. It should be outside the vagrant block. config.vm.network 'private_network', ip: '10.161.68.209' At least that's how mine is working. |
Spots, you mean it should be outside the config.vm.provider block, and say |
Yes, sorry, got in a hurry and forgot to come back. Here's a config I just used to launch a box:
In my customization spec I have it set to a specific address(just something I'm not using NOT the address I want the VM to be). The config.vm.network line will overwrite the ip in the customization spec with the one you set. |
Thanks Steve. No cigar yet though, even with your exact vagrantfile as seen in your last post there, but with added "vsphere.insecure = 'true'". I'm thinking it's because my ruby is v1.8.7, so will try a fresh vagrant install tomorrow. |
:( For reference I'm using a Ubuntu 14.04 x64. I installed ruby 1.9.3p551 using rbenv. Vagrant version 1.7.1 |
Bingo! There was a rather obvious error on my part in the end - which was failing to have a valid vmware-tools on the template. BTW this works with enterprise ruby v.1.8.7 (so having a minimum ruby v.1.9.3 is not a condition after all) and maybe some other, older dependencies I'm not sure, as well as with the most recent recipe described in http://sdorsett.github.io/2014/04/19/vagrant-install/. The OSes we're working with are Centos 6.x. |
great job! @Spots this fixed my issues here as well. I created the specs and added that to my vagrant file and it worked like a charm after hours of headache. |
i have no idea how to configure the specs |
@Y4Rv1K and anyone else hitting this error:
This just means that you have specified more private IP's in your Vagrantfile than the number of existing static IP interfaces in your VSphere spec. Either decrease the number of private IP's, or increase the number of available static interfaces. |
has anyone encounter the error "NicSettingMismatch: fault.NicSettingMismatch.summary" |
@simsunny22 I encountered that when I set more nics in my customization spec than were configured on my template. To remedy that, try converting your template to a powered-off VM, edit-settings, add an additional network device, then convert it back to a template |
@djosborne |
I get the following when trying to run vagrant:
[root@chef vagrantfile]# vagrant up --provider=vsphere
Bringing machine 'default' up with 'vsphere' provider...
undefined method `ipAddress=' for #<RbVmomi::VIM::CustomizationUnknownIpGenerator:0x007f6af8f9d520
Here's my Vagrant file, I've verified all the spelling\locations\etc:
[root@chef vagrantfile]# cat Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = 'dummy'
config.vm.box_url = 'dummy.box'
config.vm.provider :vsphere do |vsphere|
vsphere.host = '{vSphere host}'
vsphere.data_center_name = 'Datacenter'
vsphere.compute_resource_name = '{Cluster}'
vsphere.template_name = 'Template 1'
vsphere.user = 'Vagrant'
vsphere.password = 'xxxxx'
vsphere.insecure = 'true'
vsphere.data_store_name = 'LUN 11'
vsphere.customization_spec_name = 'NE Template'
config.vm.network 'private_network', ip: '192.168.1.200'
end
end
The text was updated successfully, but these errors were encountered: