Skip to main content

Hello,

I am trying to remove a client from subclient (PowerShell), and it works in most of cases, however I came across with a strange case when automation just does not work, for no reason (the target client stays in the subclient)

I tried to use both methods I know:

Remove-CVVirtualMachine and qoperation execute

both with “error code: 0” on exit 😐

Also, I would deeply appreciate if anyone share the info under witch module in “process manager > logging” commands execution log can be found

Oki, I found the logs:

qcommand
qscript
qsdk

however deletion still not working  


In case someone else having the same issue, here is the answer to a question “how to remove a client from subclient

I solve it by using: qoperation execute -af $xml_path

here is an VERY important fragment of XML request

...

<vmContent>
            <children equalsOrNotEquals="1" displayName="$target" type="$client_type" name="$client_hash" />
</vmContent>

 

where $client_hash is strGUID of target client and $client_type is integer. I was not able to find anywhere in CV documentation that name parameter is critical for deleting clients with type 9 -- “Virtual Machine” 😑

Here is the full XML block:

$xmltemplate =@"
<?xml version='1.0' encoding='UTF-8'?>
<App_UpdateSubClientPropertiesRequest>
<association>
<entity appName="Virtual Server" instanceName="VMware" backupsetName="$BackupsetName" clientName="$VCenterName" subclientName="$SubclientName" />
</association>
<subClientProperties>
<vmContentOperationType>DELETE</vmContentOperationType>
<vmContent>
<children equalsOrNotEquals="1" displayName="$target" type="$client_type" name="$client_hash" />
</vmContent>
</subClientProperties>
</App_UpdateSubClientPropertiesRequest>
"@

 

 

 


Reply