Quantcast
Viewing all articles
Browse latest Browse all 293210

Re: cloning base hard disk that has a snapshot

yep, here is what i have come up with so far: it's fun! i'm getting closer....

 

 


how in the world do we get code in here to look pretty? what tags do we need?

 

$newarray = @()
$tovm = VDEVLEBSDB11
$frovm = VFUNCEBSDT11
$tovm | Get-HardDisk | select filename
$frohds = $frovm | Get-HardDisk | where {$_.Name -ne "Hard Disk 1"} | select Filename
foreach ($value in $frohds){
$newvalue = $value.Filename -replace '-000001',''
$newarray += $newvalue
}
Disconnect-VIServer * -Confirm:$false
Connect-VIServer atl-esxi-big01 -User root -Password "wups"
foreach ($oldhd in $newarray){
$newhd = $oldhd -replace $frovm,$tovm
Write-Host $huh
$vmhd = Get-HardDisk -Datastore "BIS-02-FP2-130" -DatastorePath $oldhd
$vmhd | Copy-HardDisk -DestinationPath $huh -DestinationStorageFormat Thin -RunAsync -WhatIf
}

Viewing all articles
Browse latest Browse all 293210

Trending Articles



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