Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 185049

Re: adding 100GD D drive to 50vms

$
0
0

To add the harddisk to the VMs can be done with the New-Harddisk cmdlet.

I assume the names of the VMs are in a CSV file

Import-Csv c:\vmanmes.csv -UseCulture | %{

   Get-VM -Name $_.Name | New-Harddisk -CapcityGB 100

}

Changing drive letters is something that needs to be done in the guest OS.

For that you can use the Invoke-VMScript cmdlet.

 

Launch something like the following script in the guest, before adding the new harddisk.

$driveD = Get-WmiObject -Class Win32_Volume -Filter "DriveLetter = 'D:'"

Set-WmiInstance -Input $driveD -Arguments @{DriveLetter="E:"; Label="Label"}

Depending on your OS and the policy you have set, the new harddisk will be discovered and assigned as the D-drive.

If not, you will have to use the "diskpart" command (through Invoke-VMScript) to make the new volume known to the guest OS


Viewing all articles
Browse latest Browse all 185049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>