Pages: [1]
Print
Author Topic: Add additional Harddisk to VMs  (Read 890 times)
dma0211
Newbie
*
Posts: 15


View Profile
« on: August 24, 2009, 03:30:42 PM »

Code:
$VIServer = Read-Host "Please enter a Virtual Center name"
connect-viserver $VIServer

$VMS = Get-VM -location (Get-Cluster "OR Anything else you want")
foreach ($VM in $VMS){
new-harddisk -CapacityKB 10010101 -ThinProvisioned
}

You will also need to use something like psexec to partition and format the disk. Can be a little tricky since you have to exit diskpart first.


So a bat file does the job.


Code:
Diskpart /s \\path\to\your\dispart\information.txt
format e: /FS:NTFS /y

Example for information.txt

rescan
select disk 1
create partition primary
assign letter=E
active








Logged
Pages: [1]
Print
Jump to: