VMware Cloud Community
s31064
Contributor
Contributor

Configure Network Setting for Multiple VMs Created from a Template

As a fairly basic VMware user, I'm not even sure what I want to do is possible, but here goes.

I need to create 50 servers from a template.  This is ESXi 6.7.0, and for some reason, they won't install vCenter Server.  Creating the template and creating the VMs from the template isn't an issue (the VMware.VimAutomation.* and VMware.PowerCLI PowerShell modules make that easy), but what I'm trying to do now is find a way to set the IP addresses (static), masks, gateways, DNS and proxy settings for all of the newly created VMs, preferably using a PowerShell script although I'm open to learning/using another tool if that's easier or necessary.  I really don't want to have to login to the VMware Remote Console on each of these machines to do basic setups if I can avoid it.

Anybody have any advice, scripts or other tools I can use to accomplish this?

Reply
0 Kudos
10 Replies
daphnissov
Immortal
Immortal

This would really be *so* much easier with vCenter. Why, again, is there no vCenter in use here?

Reply
0 Kudos
s31064
Contributor
Contributor

I wish I knew.  We have a license for it, but for some reason, the powers-that-be won't even entertain the thought of installing it.  I know, I've asked a few times and the only answer I get is "We're not installing it".

Reply
0 Kudos
daphnissov
Immortal
Immortal

It needs to be installed. Period. There is no reason to saddle yourselves with substantially more burden and technical debt by developing complex scripts and automation when it comes built in to the product *YOU ALREADY OWN*.

Reply
0 Kudos
s31064
Contributor
Contributor

Hey, I'm on your side.  I see no reason not to use a tool to make life easier, especially if we already have a license for it.  Unfortunately, my boss's boss doesn't see it that way.

Is there any other way to do this?

Reply
0 Kudos
daphnissov
Immortal
Immortal

Almost everything you're going to find also required vCenter. There are always other ways but, again, vCenter is almost always a prerequisite. So honestly your best bet is to tell them it can't be done without vCenter, which is basically true.

Reply
0 Kudos
s31064
Contributor
Contributor

@daphnissov

Sorry for the delay answering, it took me a while to get permission to install the vCenter appliance, and I went on vacation immediately after that.

Now that I have vCenter, are there any scripts or other tools I can use to create 50 servers from a template and to set the IP addresses (static), masks, gateways, DNS and proxy settings for all of the newly created VMs?  I'd prefer to use a PowerShell script since I'm pretty familiar with that, but I'm open to using another tool if it makes it easier.

Reply
0 Kudos
daphnissov
Immortal
Immortal

If you don't mind doing them one-by-one, create your template and put your PS script inside which will set proxy information. Create a Customization Spec within vCenter and go to the network option to preset your IP information (mask, gateway). Tell it to prompt you for the IP address. Configure the run-once section to call that PS script. Then  just deploy your template and select that spec. It'll ask for the IP address and deploy it with your networking info, and then will execute that PS script that'll set the proxy info inside the guest.

Reply
0 Kudos
s31064
Contributor
Contributor

The whole idea is to not do them one by one.  This is a test environment for a much larger rollout before the EOY with over 200 VMs that will need to be configured for a few different subnets.  I know I can create the VMs from a PS script reading the VM name and guest OS machine name from a CSV file, but I don't see where I can configure the networking from that CSV file.  I have to believe it's possible, but as I said in the original post, I'm pretty much a basic user when it comes to ESXi, I've been trapped in the Hyper-V world previously.

Reply
0 Kudos
daphnissov
Immortal
Immortal

This really is now a question of how and what exactly you want to do to operationalize this. Do you routinely need to deploy this many VMs? We're probably talking about a fair amount of ESXi hosts. Across many clusters? You said you didn't have vCenter before so this is sounding strange otherwise. Your options at this point are basically PowerCLI, vRO, or vRA with vRA probably being the least cumbersome but also an add-on purchase. Without knowing what your exact goals are it's hard to recommend one over the other.

Reply
0 Kudos
s31064
Contributor
Contributor

At the moment, we're only rolling out a 50 VM test environment, where one of the goals is to get the scripts written and tested for the 200 VM QA environment.  This test environment is a new, separate site with just an Essentials license just for this purpose.  The main site will consist of three environments, DEV, QA, and PROD.  I expect the DEV environment to get blown away and rebuilt several times a year, and that may be a reality for the QA site as well.  This is why I'm trying to automate as much of this as possible.

Reply
0 Kudos