At the end of the VDI life cycle, the clone VM is deleted from the hypervisor. This can happen as a result of administrator action through the vSphere Client or the Horizon GUI.
Before a clone VM is deleted, you need to unregister it from Cryptographic Security Platform Vault. This removes the address of the clone from Cryptographic Security Platform Vault so that the same address can be used again later. Otherwise, you will have "orphan" names in Cryptographic Security Platform Vault which will prevent you from reusing those addresses.
Important: Removing a clone from Cryptographic Security Platform Vault without decrypting the data first means that the data on all encrypted disks will be lost. If you want to decrypt the data first, see Decrypting a Disk Using the CLI.
- For Linux, log into the VM as
root. For Windows, log in as a System Administrator and open a Command Prompt or start Windows PowerShell. Remove the VM using the CLI or the Entrust Python-based REST API. After the clone VM has been removed, none of its encrypted drives can be accessed. If the clone boot partition was encrypted, the clone is powered off after it is removed from Cryptographic Security Platform Vault.
If you want to use the CLI, enter the command
hcl unregister [-a] [-u username [-p password]] [-y], where:-atellshclthat the VM is registered with Cryptographic Security Platform Vault but it is currently unauthenticated. This option requires Cryptographic Security Platform Vault Cloud Admin user account credentials. Omit this option if the VM is currently registered and authenticated with Cryptographic Security Platform Vault.-uis a Cryptographic Security Platform Vault user account with Cloud Admin privileges. If you do not specify the account name,hclprompts you for the information.-pis the password for the Cryptographic Security Platform Vault account. If you do not specify this password you will be prompted for the information.-ytells the command to run non-interactively.
If you want to use the API:
- Make sure Python is available on the VM.
- If needed, install the Entrust APIs on the machine from which you want to do the clean up. You can download the API package from the Cryptographic Security Platform Vault webGUI by clicking Cloud in the top menu bar, selecting Actions > Download Policy Agent, then downloading the file called
hcs-api-RelaseNumber-BuildNumber.tgz. For example,hcs-api-10.4.6-12346M.tgz. - Copy the
hcs-api-RelaseNumber-BuildNumber.tgzfile to the VM and unpack the archive so that you have anhcs-apidirectory with 5 python files and one executable calledhicli. Create a Python script with the following lines:
keycontrol=$1 cvmset=$2 clonevm=$3 username=$4 password=$5 hicli kc select $keycontrol hicli user login $username --password=$password hicli cvmset select $cvmset yes | hicli cvm rm $clonevm
Where
$usernameis a Cryptographic Security Platform Vault user account with Cloud Admin privileges and$passwordis the password for that Cryptographic Security Platform Vault account.