sylstyle
Contributor
Contributor

Edit settings for several VMs

Hi,

I am searching for a script capable of changing a specific setting for several VM, do you know if someone has already developed something like that? I posted into the PowerCLI forum but if it's possible in another language, i am interested Smiley Happy

Thanks,

Syl

0 Kudos
5 Replies
RvdNieuwendijk
Leadership
Leadership

Hi Syl,

you can use PowerCLI to change a specific setting on multiple VM's. For example to change the number of virtual CPU's from one to two on all VM's in cluster MyCluster you can do something like:

Get-Cluster MyCluster | Get-VM | Where-Object {$_.NumCPU -eq 1} | Set-VM -NumCPU 2

Which setting do you want to change?

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
gary1012
Expert
Expert

Not sure what settings you'd like to change, but here's a link to changing a VMs advance settings. Sites of interest might be:

http://wannemacher.us/

http://www.lucd.info/

Community Supported, Community Rewarded - Please consider marking questions answered and awarding points to the correct post. It helps us all.

Community Supported, Community Rewarded - Please consider marking questions answered and awarding points to the correct post. It helps us all.
0 Kudos
sylstyle
Contributor
Contributor

Thanks you for your quick reply, in fact I would like to not select all the VM of a cluster... maybe this command is working with a ressource pool?

I would like to change:

-Number of vCPU

-Memory

CPU and RAM affinity in the Ressources tab:

-Advanced CPU

-Advanced Memory

Regards, Syl

0 Kudos
sylstyle
Contributor
Contributor

I found the way to change vCPU and memory to a ressource pool and it works perfectly thanks Smiley Happy

Now I just miss the CPU/memory affiinity setting...

0 Kudos
LucD
Leadership
Leadership

Have a look at the Set-VMResourceConfiguration cmdlet for the CPU affinity.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos