VMware Horizon Community
NPDgroup
Contributor
Contributor

SendLinkedCloneRecompose

Good Morning.

I'm trying to script a recompose for pools after we perform windows patching. I seem to be hitting an issue running the SendLinkedCloneRecompose command.

My View server version is 5.3.2 and my vcenter is 5.5

The error I'm getting is below. I've tried it both with the variables and manually entering the paths for the parentvm and snapshot path and it fails both ways.

Send-LinkedCloneRecompose : PowershellService::SendLinkedCloneRecompose FAILED, error=Could not get snapshot list for V

M at path /PWVDI/vm/ITStaffImage: null

At C:\bin\vdirecompose.ps1:78 char:67

+ get-pool -pool_id $pool |get-desktopVM | send-linkedclonerecompose <<<<  -schedule ((get-date).AddMinutes(2)) -parent

vmpath "$pooldetails" -parentsnapshotpath "$fullsnap" -forceLogoff $true -stoponerror $true

    + CategoryInfo          : InvalidResult: (vmware.view.pow...dCloneRecompose:SendLinkedCloneRecompose) [Send-Linked

   CloneRecompose], Exception

    + FullyQualifiedErrorId : PowershellService::SendLinkedCloneRecompose FAILED,vmware.view.powershell.cmdlets.SendLi

   nkedCloneRecompose

See below for the powershell script...I think its something with the command itself not the script but any help would be appreciated.

Param (

  [Parameter(Mandatory=$True,Position=0)]

  [string]$Pool

)

add-pssnapin vmware.vimautomation.core -ea silentlycontinue

add-pssnapin vmware.view.broker -ea silentlycontinue

##Set-PowerCLIConfiguration -InvalidCertificateAction Accept

connect-viserver -Server FQDNVcenterServer

$pooldetails=get-pool -pool_id $pool |foreach { $_.parentvmpath }

         $vmname=$pooldetails.Split('/')[-1]

         $snaps=get-snapshot $vmname |foreach {$_.id}

            foreach ($snap in $snaps) {

                $snappy=get-snapshot -VM $vmname -id $snap |foreach {$_.Name}

                $fullsnap="$fullsnap`/"+$snappy

            }

           

           

write-host "Snapshot full path is $fullsnap"

write-host "ParentVMPath is $pooldetails"

write-host "PoolID is $pool"

write-host "You are about to recompose pool $pool" -foregroundcolor green

            $Answer = read-host "Would you like to continue (y or n)"

                if ($Answer -eq "y") {

                     write-host "Continuing...."

                     ##break

                }

    

                if ($Answer -eq "n") {

                    write-host "Exiting......"

                    exit

                }

#write-host "Snapshot full path is $fullsnap"

#write-host "ParentVMPath is $pooldetails"

#write-host "PoolID is $pool"

write-host "Recomposing pool $pool...Please check the VDI console and VC server for the status"

get-pool -pool_id $pool |get-desktopVM | send-linkedclonerecompose -schedule ((get-date).AddMinutes(2)) -parentvmpath "$pooldetails" -parentsnapshotpath "$fullsnap" -forceLogoff $true -stoponerror $true

                       

disconnect-viserver -confirm:$false

Reply
0 Kudos
0 Replies