dell-democenter

MODULE 3 - PROTECT VMWARE VIRTUAL MACHINES

LESSON 5 - CENTRALIZED INSTANT ACCESS RESTORE OF VM ASSET

Doing Instant Access Restores in a vMware Environemnt requires us to use Managed Object References (Moref´s) First, we set somw Variables for the Environmen:

$vcenterName="vcsa-7.demo.local"
$RestoreHost="esxi03-7.demo.local"
$OriginalVM="LINUX-01"

Next, we read out the Target Datacenter Inventory Source

$InventorySource=Get-PPDMinventory_sources -Type VCENTER -filter "`'address eq `"$vcenterName`"`'"

Read the Datacenter Moref

$Datacenter=$InventorySource| Get-PPDMvcenterDatacenters
$Datacenter

Alt text

Get Information on the ESX Host we want to restore

$ESXHOST=Get-PPDMhosts -type ESX_HOST -filter "`'name eq `"$RestoreHost`"`'"

Get the Moref´s of the Host

$HostMorefs=Get-PPDMvcenterMorefs -ID $InventorySource.ID -hostMoref $ESXHOST.details.esxHost.hostMoref
$HostMorefs

Alt text

Read the Original Asset

$Asset=Get-PPDMassets -filter "`'name eq `"$OriginalVM`"`'"

Get the latest Copy for the Asset

$LatestCopy=Get-PPDMlatest_copies -assetID $Asset.id

And finally run the Restore

$Restore=Restore-PPDMVMAsset -INSTANT_ACCESS -CopyObject $LatestCopy `
-NewVMName INSTANT_1 `
-InventorySourceId $InventorySource.id `
-dataCenterMoref $Datacenter.moref `
-hostMoref $HostMorefs.moref `
-Description "from Powershell"
Get-PPDMRestoredCopies

Alt text

Now See the Status of the Instant Access Sewssion

$Restore | Get-PPDMRestored_Copies

Alt text

TLDR

«Module 3 Lesson 4 This Concludes Module 3 Module 4 Lesson 1»