VMware Cloud Community
sevenply
Contributor
Contributor

remove VM from Pool

I would like to remove a VM from a certain pool inventory via PowerCli.

For example my pool "one" contains three VM's and I want to remove a certain VM programmatically. Is that possible?

Tags (4)
0 Kudos
5 Replies
Linjo
Leadership
Leadership

Do you mean a pool of View-desktops?

// Linjo

Best regards, Linjo Please follow me on twitter: @viewgeek If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
sevenply
Contributor
Contributor

Yes, exactly.

For Example I have a pool with three VM's (VM1,Vm2...) and I want to remove VM1 from the Inventory.

0 Kudos
LucD
Leadership
Leadership

Afaik, the current View snapin doesn't have such a cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
satya1
Hot Shot
Hot Shot

sevenply wrote:

Yes, exactly.

For Example I have a pool with three VM's (VM1,Vm2...) and I want to remove VM1 from the Inventory.

hi  please follow below steps

Deleting the virtual machine from vCenter Server

Note: If you run the SviConfig RemoveSviClone command to remove linked clone data, the virtual machine is removed from vCenter Server. You can skip this task.
To delete the virtual machine from vCenter Server:
  1. Log in to vCenter Server using the vSphere Client.
  2. Right-click the linked clone virtual machine and click Delete from Disk.

Removing the virtual machine from the ADAM database

These steps are only applicable if the virtual machine has not been deleted from vCenter Server:
Find the virtual machine's GUID stored in ADAM:
  1. Log in to the culprit virtual machine using the vSphere Client Console or directly using Windows Remote Desktop Protocol (RDP).
  2. Open the Windows registry, and go to HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware VDM\Node Manager\Server DN.
  3. Record the cn=<GUID>.

If the virtual machine has already been deleted from vCenter Server:

  1. Log in to the machine hosting your VMware View Connection Server through the VMware Infrastructure Client or Microsoft RDP.
  2. Open the ADAM Active Directory Service Interfaces Editor.

    • In a Windows 2003 Server, click Start > Programs > ADAM > ADAM ADSI Edit.
    • In a Windows 2008 Server, c lick Start > All Programs >Administrator Tools > ADSI Edit.

  3. Right-click ADAM ADSI Edit and click Connect to.
  4. Ensure that the Select or type a domain or server option is selected and the destination points to localhost.
  5. Select Distinguished Name (DN) or naming context and type dc=vdi, dc=vmware, dc=int.
  6. Locate the GUID of the virtual machine.

    To locate the GUID of the virtual machine:

    1. Right-click the Connection DC=vdi,dc=vmware,dc=int [localhost] , and click New > Query.
    2. Under Root of Search, click Browse.. and select the Servers organizational unit.
    3. Click OK.
    4. In the Query String, paste this search string:

      (&(objectClass=pae-VM)(pae-displayname=<Virtual Machine name>))

      Where <Virtual Machine name> is the name of the virtual machine for which you are trying to locate the GUID. You may use * or ? as wildcards to match multiple desktops.

    5. Click OK to create the query.
    6. Click the query in the left pane. The virtual machines that match the search are be displayed in the right pane.

  7. Record the GUID in cn=<GUID>.
  8. T ake a complete backup of ADAM and Composer database. For more information, see Performing an end-to-end backup and restore for View Manager 3.x/4.x (1008046).
Delete the pae-VM object from the ADAM database:
  1. Open the ADAM Active Directory Service Interfaces Editor.
    • In a Windows 2003 Server, click Start > Programs > ADAM > ADAM ADSI Edit.
    • In a Windows 2008 Server, c lick Start > All Programs > Administrator Tools > ADSI Edit.

  2. Right-click ADAM ADSI Edit and click Connect to.
  3. Choose Distinguished name (DN) or naming context and type dc=vdi, dc=vmware, dc=int.
  4. Locate the OU=SERVERS container.
  5. Locate the corresponding virtual machine's GUID (from above) in the list which can be sorted in ascending or descending order, choose Properties and check the pae-DisplayName Attribute to verify the corresponding linked clone virtual machine object.
  6. Delete the pae-VM object.

Yours,

Satya

sevenply
Contributor
Contributor

Thanks. And how can I add a VM like that?

0 Kudos