VMware Cloud Community
jimmski
Contributor
Contributor

Bulk Edit VM Hard Disk Settings

Hi,

I've been using VMs for a while now although I'm not an expert by any means as my experience with configuring them is sporadic. I'm mostly a user of them. But having said that I am responsible for around 100 VMs globally that are grouped into clusters of around 15 per cluster. We use them as training PCs and so install our trading system front end on them. As they are training machines they are normally in a non-persistent state as we don't want students messing around with them permanently. So we reset them after a class.

However, periodically we need to update the software on each student VM when a patch has been applied to out training system trading servers. This involves logging into the client application on the VM and that downloads and installs the latest front end from the trading system servers.

For the install to be permanent we need to set the VMs to a persistent state for the upgrade and then we need to set them back to non-persistent afterwards.

At the moment I have to shut down the VMs (I can group select all the ones in the cluster and close down the OS all at once) and then individually go into Edit Setting and change each VM's hard disk to persistent. It takes forever! Then I have to go back and individually set them to non-persistent again afterwards. There doesn't seem to be anyway of group editing the persistent/non-persistent states of a cluster of VMs.

Is this possible? If not why not? I can't be the only user who has come up against this hurdle when managing large-ish numbers of VMs.

Sorry if this is such a basic question - I did search the help forum but couldn't find anything similar. Apologies if this has been answered already somewhere!

Thanks in advance.

4 Replies
MBreidenbach0
Hot Shot
Hot Shot

Should be possible to script this using PowerCLI. Check the PowerCLI forum VMware PowerCLI

Shutdown-VMGuest shuts down VMs

Set-Harddisk can set Persistant / Non Persistant Set-HardDisk - vSphere PowerCLI Cmdlets Reference

jimmski
Contributor
Contributor

Many thanks. I take it this isn't possible via the web GUI then?

0 Kudos
Devi94
Hot Shot
Hot Shot

you need to do it with powershell script. we don't have any GUI option to do bulk edits.

0 Kudos
vijayrana968
Virtuoso
Virtuoso

Below command can be modified according to your need for this task.

Get-VM | % { Get-HardDisk -VM $_ | Where {$_.Persistence -eq "IndependentPersistent"} | `
% {Set-HardDisk -HardDisk $_ -Persistence "Persistent" -Confirm:$false} }

0 Kudos