VMware Horizon Community
vivekrishna
Enthusiast
Enthusiast

Detaching persistant disks

Is there anyway I can detach the persistant disk from the VM, using powershell or Vmware View CLI.

I tried in many sites and no command for detaching the disks.

Please help.

Thanks,

Vivek

Reply
0 Kudos
6 Replies
Shreyskar
VMware Employee
VMware Employee

The cmdlet is 'Get-ProfileDisk' and parameter to detach persistent disk is 'detachUdd'.

Doc: View PowerCLI cmdlet Parameters

View API - VMware API Explorer - VMware {code}  > Click on 'Service Type' > Type 'Persistentdisk' and you will get all the options.

Reply
0 Kudos
vivekrishna
Enthusiast
Enthusiast

what will be the script look like.

Get-ProfileDisk - ???

Reply
0 Kudos
Shreyskar
VMware Employee
VMware Employee

Below cmd will retrieve info about persistent disk that belongs to specific user: Test it for a test account before running directly on production:

Get-ProfileDisk –Username <domain>\<username>

Getting list of detached persistent disks only:

Get-ProfileDisk –Username <domain>\<username>  -Status <Detached/InUse/Archiving>

Detaching the PD:

Get-ProfileDisk –Username <domain>\<username> -detachUdd

Reply
0 Kudos
vivekrishna
Enthusiast
Enthusiast

Get-ProfileDisk –Username <domain>\<username> -detachUdd

As I checked, till this its okay.Get-ProfileDisk –Username <domain>\<username>

but there is no such parameter like -detachUdd.

Could you please reverify

Reply
0 Kudos
Shreyskar
VMware Employee
VMware Employee

Hi vivekrishna

Try with below.It should work:

Get-ProfileDisk –Username <domain>\<username> -composerTask detachUdd

check attached guide.

Reply
0 Kudos
vivekrishna
Enthusiast
Enthusiast

Hi, still the same, please find the error below

Get-Profiledisk -Username 'name' -composertask detachUdd

pastedImage_0.png

Reply
0 Kudos