When you clone an encrypted virtual machine, the clone is encrypted with the same keys. To change keys for the clone, perform a recrypt of the clone using the API. See vSphere Web Services SDK Programming Guide.

You can perform the following operations during clone.

  • Create an encrypted virtual machine from an unencrypted virtual machine or template virtual machine.
  • Create a decrypted virtual machine from an encrypted virtual machine or template virtual machine.
  • Recrypt the destination virtual machine with different keys from that of source virtual machine.

You can create an instant clone virtual machine from an encrypted virtual machine with the caveat that the instant clone shares the same key with the source virtual machine. You cannot recrypt keys on either the source or the instant clone virtual machine. See vSphere Web Services SDK Programming Guide.

Prerequisites

  • Establish a trusted connection with the KMS and select a default KMS.
  • Create an encryption storage policy, or use the bundled sample, VM Encryption Policy.
  • Required privileges:
    • Cryptographic operations.Clone
    • Cryptographic operations.Encrypt
    • Cryptographic operations.Decrypt
    • Cryptographic operations.Recrypt
    • If the host encryption mode is not Enabled, you also must have Cryptographic operations.Register host privileges.

Procedure

  1. Browse to the virtual machine in the vSphere Client inventory.
  2. To create a clone of an encrypted machine, right-click the virtual machine, select Clone > Clone to Virtual Machine, and follow the prompts.
    Option Action
    Select a name and folder Specify a name and target location for the clone.
    Select a compute resource Specify an object for which you have privileges to create encrypted virtual machines. See Prerequisites and Required Privileges for Encryption Tasks.
    Select storage Make a selection in the Select virtual disk format menu and select a datastore. You can change the storage policy as part of the clone operation. For example, changing from using an encryption policy to a non-encryption policy decrypts the disks.
    Select clone options Select clone options, as discussed in the vSphere Virtual Machine Administration documentation.
    Ready to complete Review the information and click Finish.
  3. (Optional) Change the keys for the cloned virtual machine.
    By default, the cloned virtual machine is created with the same keys as its parent. Best practice is to change the cloned virtual machine's keys to ensure that multiple virtual machines do not have the same keys.
    1. Decide upon a shallow or deep recrypt.
      To use a different DEK and KEK, perform a deep recrypt of the cloned virtual machine. To use a different KEK, perform a shallow recrypt of the cloned virtual machine. For a deep recrypt, you must power off the virtual machine. You can perform a shallow recrypt operation while the virtual machine is powered on, and if the virtual machine has snapshots present. Shallow recrypt of an encrypted virtual machine with snapshots is permitted only on a single snapshot branch (disk chain). Multiple snapshot branches are not supported. If the shallow recrypt fails before updating all links in the chain with the new KEK, you can still access the encrypted virtual machine if you have the old and new KEKs.
    2. Perform a recrypt of the clone using the API. See vSphere Web Services SDK Programming Guide.