Preparing to Detach the VM

After the VM is "Fully Cached" and you want to start the detach process, the first task required is "Prepare to detach" the VM from Velostrata. This task takes the VM disks from the Velostrata cache and object store and creates the native data drives in the  target cloud. A Velostrata exporter is deployed automatically in the cloud to perform this task.

The exporter runs through all data disks and converts them to native cloud disks, after this first iteration is completed, the exporter continues to write the changes committed since its previous execution. This task runs in cycles.

After sufficient progress has been achieved (3 cycles), the VM is marked as "Ready to Detach".

The VM can then be detached from Velostrata in minutes. The Velostrata exporter continues to synchronize the VM disks from cache into the native cloud storage until detached or until manually stopped (stop prepare to detach). Once the VM is in the "Ready to Detach" state you will effectively have to “cut over” and will need to schedule a downtime slot for the actual detach action.

The VM must be in the Fully Cached state prior to running the prepare to detach operation. If the VM is not in the Fully Cached state, first run the procedure to migrate the VM storage to the cloud.

Note: If you want to stop (revert back) after the preparing to detach process has finished, you can stop or rollback the detach process. 

When working in cache mode, all cached data is stored in encrypted disks attached to the Velostrata Cloud Extension. During detach, you can choose if you want to  use encrypted disks or not, and can optionally specify the key to be used. For more information, see EBS Encryption Key Preparation.

On-prem-to-Cloud: To prepare to detach in vSphere:
  1. On the vSphere Web Client, select the desired Virtual Machine.
  2. Right-click on the required VM and select Velostrata Operations > Migration Operations > Prepare Detach.
  1. Select the Storage Type and then click OK.
  2. For AWS, if you wish to use EBS encryption for native volumes, select Encrypt EBS volume, and select the encryption key alias to be used. If this is not specified, an AWS-generated KMS default key is used.

Note: If you want to use a specific KMS key for encryption,  add the AWS Velostrata service user to the list of users who can assign the KMS key.

After the ready to detach process is completed, the VM is Ready to Detach.

GCP-to-Cloud: To prepare to detach in vSphere:
  1. On the vSphere Web Client, select the desired Virtual Machine.
  2. Right-click on the required VM and select Velostrata Operations > Migration Operations > Prepare Detach.
  1. Select the Disk Type.
  2. Select the Service Account.
  3. Click OK.

After the ready to detach process is completed, the VM is Ready to Detach.

On-prem-to-Cloud: To prepare to detach the VM using PowerShell:
  1. In PowerShell, connect to the Velostrata Manager by running Connect-VelostrataManager.
  1. When prompted enter details for the Server, Username (apiuser) and Password (the subscription ID).
  2. To prepare to detach, run get-vm myserver | Start-VelosPrepareToDetach -StorageSpec “string” or for AWS, run get-vm myserver | Start-VelosPrepareToDetach -StorageSpec “string” -EncryptDisk -DiskEncryptionKey "string".

The command requires a StorageSpec string value:

  • For AWS, this is the volume type, for example, SSD-based EBS volumes are type gp2.
  • For Azure, this is the storage account ID. In Azure, select the required Storage account, and copy the partial URL after the https://portal.azure.com/#resource.

For AWS, you can create an encrypted EBS disk during the prepare to detach stage:

  • EncryptDisk - will create an encrypted EBS disk during prepare to detach stage. When selected, you can provide an alias key ID, or let the system use the default CMK.
  • DiskEncryptionKey - when using -EncryptDisk, you can specify a KMS key alias. Note that the key should be created in the KMS prior to the operation and the VelosMgrGroup must be added to the list of users which can assign the KMS key.
  1. To check the state of the task, run Get-Velostask [ID] and optionally Get-Velostask [ID] |fl
  1. Monitor the created vSphere Cloud Instance Information for  progress.

NOTE: The vCenter task may be completed before the VM is actually ready for detaching. Monitor the portlet and the task in Powershell as reliable sources of information.

Cloud-to-Cloud: To prepare to detach the VM using PowerShell:
  1. In PowerShell, connect to the Velostrata Manager by running Connect-VelostrataManager.
  2. When prompted enter details for the Server, Username (apiuser) and Password (the subscription ID).
  3. To prepare to detach, run Start-VelosPrepareToDetach [-Id] <String[]> -StorageSpec <String>
  4. For example, run: Start-VelosPrepareToDetach -id i-0029a39f53eb73818 -StorageSpec Standard
  5. The example starts the detach preparation for an AWS Workload i-0029a39f53eb73818. The data disks are created in GCP (volume type: Standard).
Id     EntityId            Type            Initiator              ExternalTaskId State   StartTime 
--      --------               ----              ---------                 --------------    -----    --------- 
t-26   i-0029a39f53eb73818 PrepareToDetach powershell_192.168.0.1                Success 5/18/20...