I'm trying to get some error control when taking a 'new-snapshot' of a VM (protected by SRM), see below code :
$VMname = <VMname>
$snapname = <snapshotname>
try {
Get-VM -Name $VMname| New-Snapshot -Name $snapname -Memory -Quiesce -ErrorAction Stop
"SNAPSHOT - OK" | Tee-Object -FilePath $logPath -Append
}
catch
{
$_ | Tee-Object -FilePath $logPath -Append
"SNAPSHOT nemen mislukt" | Tee-Object -FilePath $logPath -Append
exit 1
Break
}
The code is failing for VM that are protected with SRM and I'm getting the error :
New-Snapshot : 25/02/2015 11:47:28 New-Snapshot The method is disabled by 'com.vmware.vcDr'
At C:\Tools\Windows_Updates\CreateSnapVM - Copy.ps1:34 char:27
+ Get-VM -Name $VMname| New-Snapshot -Name $patchname -Memory -Quiesce -ErrorA ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-Snapshot], MethodDisabled
+ FullyQualifiedErrorId : Client20_VMServiceImpl_CreateSnapshot_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewSnapshot
Anyone any idea how the get some errorcontrol on the 'New-snapshot' command for SRM protected VMs ?
Any help appreciated.
Are you sure you are trying to perform this operation on the protected VM and not the placeholder VM?
Are you sure you are trying to perform this operation on the protected VM and not the placeholder VM?
Thank you for your reply. Indeed I refined the code so the snapshot is now always taking on the protected VM, and no longer the placeholder too.
Hi NicOr,
I am getting a similar error when doing a backup of a SRM protected VM, difference is that the backup is performed by EMC EBR, which is basically the same as VDP. My error is:
avvcbimage Warning <16004>: Soap fault detected, Snapshot task - NOT ok, Msg:'SOAP 1.1 fault: "":ServerFaultCode [no subcode]
"The method is disabled by 'com.vmware.vcDr'"
I was wondering if maybe I am also trying to backup the placeholder and since you mentioned you modified the PowerCLI code to backup the protected host instead the placeholder, I was wondering if you could post it here.
Thanks in advance.
Hi armandogm,
here is a powercli snippet I use to retrieve the placeholder VMs.
Get-VM | where {$_.ExtensionData.Config.ManagedBy.extensionKey -like "com.vmware.vcDr*" -and $_.ExtensionData.Config.ManagedBy.Type -ieq 'placeholderVm'}
The key thing to noticed is that the ManagedBy.extensionKey is set on placeholder VMs. If I wanted to get a list of VMs excluding both the placeholder VMs and the test VMs (that replace the placeholders during a DR test). I would take the script above and modify it to something like:
Get-VM | where {$_.ExtensionData.Config.ManagedBy.extensionKey -notlike "com.vmware.vcDr*"}