You can import a VMware vSphere virtual machine as a Managed services stack instance, identify whether the instance is imported successfully, and manage the stack resources.
A default template, Import existing VM with a single disk - VMware vSphere, is shipped as a sample to import a virtual machine. You can use this template during the import of VMware virtual machines. However, this template cannot be used
to deploy new virtual machines.
Import VM by IDs or Import VM by Name to import a VMware vSphere virtual machine as a stack instance. For more information, see Import VM by IDs API and Import VM by Name API.The Import existing VM with a single disk - VMware vSphere template works only for virtual machines with single disk. Go to the template source to find the following single disk information:
disk{
unit_number = "${var.disk_0_unit_number}"
path = "${var.disk_0_path}"
label = "${var.disk_0_label}"
size = "${var.disk_0_size}"
datastore_id="${var.disk_0_datastore_id}"
}
If you are importing a virtual machine with more than one disk, clone this template to create a copy and duplicate the disk section for each additional disk. Make sure to increment the disk reference number in the variable names.
The parameter values of Import existing virtual machine - VMware vSphere template are automatically populated after a successful import. When the mapping occurs, if your variable values have dots (.), then Managed services automatically
converts them to underscore (_) and sets the new values for the template variables. The conversion occurs because the dot (.) character is not supported for the template variable values.