Skip to content
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

How to create multiple Windows servers using chef-provisioning-vsphere #93

Open
bhaliti opened this issue Oct 11, 2016 · 4 comments
Open

Comments

@bhaliti
Copy link

bhaliti commented Oct 11, 2016

Hi,

Seems like my other issue has been closed without my questions being answered.

All I want to know IS IT POSSIBLE TO BUILD MULTIPLE WINDOWS SERVERS USING CHEF-PROVISIONING-VSPHERE???

how do I modify this example you've provided to customize IPs on all the servers and join them to the domain. I want to be able to build let's say 10 servers with custom IP, name, and domain etc

with_machine_options :bootstrap_options => {
use_linked_clone: true,
num_cpus: 2,
memory_mb: 4096,
network_name: ['vlan_20_172.21.20'],
datacenter: 'datacenter_name',
resource_pool: 'cluster',
template_name: 'path to template',
customization_spec: {
ipsettings: {
dnsServerList: ['1.2.3.31','1.2.3.41']
},
domain: 'blah.com',
domainAdmin: '[email protected]',
domainAdminPassword: 'Passwordyoyoyo',
org_name: 'acme',
product_id: 'CDAA-87DC-3455-FF77-2AAC',
win_time_zone: 4
}
ssh: {
user: 'administrator',
password: 'password',
paranoid: false,
}
},
:convergence_options => {
:ssl_verify_mode => :verify_none
}

How do I modify above recipe to accomplish that???? is it even possible???

thanks

@bhaliti
Copy link
Author

bhaliti commented Oct 13, 2016

anything?

@bradwilliamson
Copy link

You need to use machine_batch when creating more than one machine. There are a lot of gotchas if you have machines that need to have different IP addresses, different port groups. Here is a generic example of something you might work off of. I might have a couple errors in here and don't currently have access to vCenter to test this. Hope it helps.

chef_gem 'chef-provisioning-vsphere' do
action :install
compile_time true
end

require 'chef/provisioning/vsphere_driver'

with_vsphere_driver host: '127.0.0.1',
insecure: true,
user: 'boomer',
password: 'sooner'

#Williamson 12-15-15 Big Hash value shared between machines
shared_options = {
:bootstrap_options => {
use_linked_clone: false,
network_name: ['vlan_20_172.21.20'],
datacenter: 'devops',
datastore: 'superfast',
resource_pool: 'devops_Production_Cluster_01',
vm_folder: 'Organizational Units/DEVOPS',
template_name: 'flark',
customization_spec: {
ipsettings: {
gateway: ["10.100.1.1"],
subnetMask: '255.255.255.0',
dnsServerList: ['10.100.1.20'],

},
domain: 'blah.com',
domainAdmin: '[email protected]',
domainAdminPassword: 'Passwordyoyoyo',
org_name: 'acme',
product_id: 'CDAA-87DC-3455-FF77-2AAC',
win_time_zone: 4
},
:ssh => {
:user => 'administrator',
:password => 'password',
:paranoid => false,
},

:convergence_options => {
:ssl_verify_mode => :verify_none
}
}
}

machine_batch do
custom_options = shared_options.dup
1.upto(10) do |i|
#Count from 10.100.90.21 to 30
custom_options[:customization_spec][:ipsettings][:ip]="10.100.90.2#{i}"
machines %w(Web1 DC1 SQL1 DC2 Web50 ChefWS1 ChefWS05 Gold Silver L1E5DVOP) do
machine_options custom_options
run_list ["recipe[chefrules::sqlmp4]"]
end
end

@bradwilliamson
Copy link

bradwilliamson commented Dec 28, 2016

Did this work for you @bhaliti
Thanks,

@bhaliti
Copy link
Author

bhaliti commented Dec 28, 2016

I have not had the time to test this yet. I really appreciate it though. Thank you!
Will let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants