ThisCalculator

Everyday

VMware vSphere VM Encryption: Step-by-Step Setup

Updated · Standard formula, shown below

VMware vSphere VM Encryption protects your virtual machines by encrypting their virtual disks and configuration files at rest. Once enabled, a VM’s data is unreadable without the correct encryption keys, even if someone copies the VMDK files or gains physical access to the datastore. This guide walks you through the prerequisites and the exact steps to enable encryption on a VM in the vSphere Client, plus what to do when things go wrong.

What You’ll Need

  • vSphere Enterprise Plus license – VM Encryption is only available with this edition (or higher).
  • An external Key Management Server (KMS) – This can be a hardware appliance or a software-based KMS that supports the Key Management Interoperability Protocol (KMIP). Examples include HyTrust, Thales, or a vSphere-native KMS (vSphere 7.0+).
  • vCenter Server – VM Encryption is managed through vCenter, not directly on ESXi hosts.
  • ESXi hosts version 6.5 or later – Both the source and target hosts must support encryption.
  • Administrator privileges – You need the Cryptographic Operations privilege (usually part of the Administrator role) to configure KMS and encrypt VMs.
  • Network access – vCenter and all ESXi hosts must be able to reach the KMS server over the network (typically port 5696 for KMIP).

Step-by-Step

  1. Add a KMS cluster in vCenter.
    1. Log in to the vSphere Client and go to Administration → Key Management Servers.
    2. Click Add KMS. Enter a name for the cluster (e.g., “Corporate KMS”).
    3. Select the KMS type (vSphere Native KMS or standard KMIP). If using standard KMIP, provide the server address and port (default 5696).
    4. Click Add to create the cluster, then select the cluster and click Add KMS again to add the actual KMS server(s). Enter the hostname/IP and port.
    5. After adding, click Establish Trust to exchange certificates. You may need to upload a CA certificate or client certificate depending on your KMS. Follow the prompts to complete the trust setup.
  2. Verify KMS connectivity. In the KMS cluster details, check that the status shows Connected for all ESXi hosts. If not, review network rules and certificate trust.
  3. Create a storage policy for encryption (optional but recommended).
    1. Go to Policies and Profiles → VM Storage Policies.
    2. Click Create. Give it a name like “Encrypted VM Storage”.
    3. In the rules, select Encryption from the drop-down, and choose Encrypt encrypted disks (or similar). You can also combine with other rules like SSD or replication.
    4. Finish the wizard. This policy will be used when deploying or migrating VMs.
  4. Encrypt an existing VM.
    1. Right-click a powered-off VM in the inventory and select VM Policies → Edit VM Storage Policies.
    2. For each virtual disk and the VM home (configuration files), select the encryption policy you created (or choose “Encrypt all disks” if you have a simpler option).
    3. Click Apply. The VM must be powered off to encrypt in place. vCenter will perform a storage migration to apply encryption.
    4. Alternatively, you can encrypt a running VM by performing a storage vMotion to a datastore with an encryption policy, but the VM must be compatible with encryption (e.g., no unsupported devices).
  5. Encrypt a new VM during creation. In the New VM wizard, on the Storage page, select the encryption storage policy you created. The VM will be encrypted from the start.
  6. Verify encryption. In the vSphere Client, select the VM and go to the Configure tab → Storage Policies. You should see the encryption policy applied. Also, check the VM’s summary – it may show a lock icon or “Encrypted” status.

Common Mistakes

  • Forgetting to add the KMS cluster before encrypting. You cannot encrypt a VM until a KMS is configured and trusted. The vSphere Client will block the action.
  • Using an unsupported ESXi version. VM Encryption requires ESXi 6.5 or later. Older hosts will not show the encryption options.
  • Not establishing trust with the KMS. If you skip the certificate exchange, the KMS will show as “Not Connected” and encryption will fail.
  • Applying encryption to a VM with unsupported virtual hardware. For example, VMs with PCIe passthrough devices or certain vGPU configurations may not support encryption. Check compatibility before proceeding.
  • Encrypting a VM while it is powered on without a storage vMotion. If you try to change the storage policy on a running VM without vMotion, the operation will fail. Always power off or use vMotion.

Tips

  • Use a dedicated KMS cluster for high availability. If your KMS goes down, you cannot power on encrypted VMs. Set up at least two KMS servers in a cluster.
  • Back up your KMS keys. Losing the keys means losing access to your VMs. Ensure your KMS has a backup and recovery procedure.
  • Test encryption on a non-critical VM first. This helps you understand the process and verify KMS connectivity before rolling out to production.
  • Combine encryption with vSAN or other storage policies. You can stack encryption with other rules like deduplication or replication, but be aware of performance overhead.
  • Monitor KMS status regularly. Add alerts in vCenter to notify you if the KMS becomes unreachable.

Troubleshooting

  • KMS shows “Not Connected” or “Unreachable”.
    • Check network connectivity from vCenter and ESXi hosts to the KMS server (ping, telnet to port 5696).
    • Verify that the KMS server is running and the KMIP service is active.
    • Re-establish trust: remove the KMS from the cluster and add it again, then redo the certificate exchange.
  • Encryption fails with an error about “no key provider”. This means the KMS is not properly configured. Go back to the Key Management Servers section and ensure the cluster is connected and trusted.
  • Cannot power on an encrypted VM.
    • Verify that the KMS is reachable from the ESXi host that is trying to power on the VM.
    • Check that the VM’s encryption keys are available – in the vSphere Client, go to the VM’s Configure tab → Encryption and see if the keys are listed as “Available”.
    • If the VM was moved to a different vCenter, you may need to re-establish trust with the KMS in the new environment.
  • Storage vMotion fails when applying encryption. Ensure the target datastore is compatible with encryption (e.g., VMFS, NFS, vSAN). Also, make sure the VM is not using any unsupported virtual devices.
  • Performance degradation after encryption. Encryption adds some CPU overhead. If you notice significant slowdowns, consider using hardware acceleration (Intel AES-NI) or offloading encryption to a dedicated controller if available.

Frequently Asked Questions

  1. Can I encrypt a VM without a KMS? No. A KMS is required to store the encryption keys. vSphere Native KMS (available in vSphere 7.0 and later) is a built-in option, but you still need to configure it as a KMS cluster.
  2. Does VM Encryption affect performance? Yes, slightly. Encrypting and decrypting data uses CPU cycles. The overhead is typically 5-10%, but it can be higher for I/O-intensive workloads. Using modern CPUs with AES-NI reduces the impact.
  3. Can I encrypt a VM that is already running? Yes, but you need to perform a storage vMotion to a datastore with an encryption policy. The VM will be temporarily encrypted during the migration. Alternatively, you can power off the VM and change the storage policy in place.
  4. What happens if I lose the KMS keys? If you lose the keys, you cannot decrypt the VM, effectively losing access to the data. Always back up your KMS keys and have a recovery plan.
  5. Does VM Encryption protect against theft of the VMDK files? Yes. If someone copies the VMDK files without the keys, they cannot read the data. However, the encryption keys are stored in the KMS, so the VM is still protected at rest.
  6. Can I encrypt only some disks of a VM? Yes. In the storage policy settings, you can apply encryption to individual disks or the VM home. For example, you might encrypt sensitive data disks but leave the OS disk unencrypted.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.