VMware Cloud Community
acousticskyy
Contributor
Contributor
Jump to solution

Controlling multiple VM's across multiple hosts?

Hi,

Apologies for what is clearly going to be a newbish question as I've just started using PowerCLI yesterday. I have 6 Host servers with 10 VMs on each and each VM with a snapshot.

I've created a script to

1) Connect to Host #1

2) Reset all 10 VMs to the snapshot (one by one)

3) Power on all the VMs (simultaneously)

4) Connect to Host #2.... rinse and repeat to Host #6.

This takes a bit over 5 minutes. I'm sure this process will speed this up if I locate the answers below:

Two questions:

-Is there a way to connect to all the servers at the same time so I can have step #3 work on all 6 host servers.

-Is it possible to have step #2 run simultaneously on each host to save on time?

Many thanks!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

With the Connect-VIServer cmdlet you can connect to multiple vSphere servers.

Only condition is that you can use the same credentials, or that SSO is implemented.

When you switch to 'multiple' mode with the Set-PowerCLIConfiguration cmdlet, you can launch cmdlets against all these servers at once.

You can now do a 'Get-VM' which will return all the VMs on all the connected vSphere servers.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

With the Connect-VIServer cmdlet you can connect to multiple vSphere servers.

Only condition is that you can use the same credentials, or that SSO is implemented.

When you switch to 'multiple' mode with the Set-PowerCLIConfiguration cmdlet, you can launch cmdlets against all these servers at once.

You can now do a 'Get-VM' which will return all the VMs on all the connected vSphere servers.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos