Importing Virtual Machines from a VCD
In cases where network bandwidth is insufficient for remote Virtual Machine (VM) import, you can pack virtualization files into an ISO, upload the ISO to the system as a Virtual CD (VCD), and import the VM using the Representational State Transfer (REST) application programming interface (API) as described in this section.
-
Virtualization files — either an Open Virtualization Appliance (OVA) file, or an Open Virtualization Format (OVF) file with its associated disk files (VMDK or VHD)
-
Ability to create an ISO
-
Access to the everRun Availability Console in order to upload the VCD
-
Access to the REST API in order to trigger the import
To import a VM from a VCD
-
Package your virtualization files into an ISO. For example, you can use the genisoimage CLI tool (part of the cdrkit suite) with the following command format:
> $ genisoimage -o <output-file-name.iso> -allow-limited-size <space-separated virtualization and disk files>The following example creates an ISO image called centos76-vhd.iso from an OVF file and VHD disk file:
> $ genisoimage -o centos76-vhd.iso -allow-limited-size CENTOS76.ovf disk0.vhdNote: Pack only one set of virtualization files per ISO (either one OVA file, or one OVF file with its disk files — not both).Note: Because the created ISO contains virtualization files (not a bootable image), you cannot use it for VM creation, only for VM import. -
Upload the ISO as a Virtual CD:
-
Log in to the everRun Availability Console.
-
Open the Virtual CDs page and upload the ISO file (see Downloading a Virtual CD).
-
To display a list of the files inside an uploaded VCD (optional):
-
ssh into the system.
-
Run the command blkid. Look for the entry that matches the VCD name.
-
List the ISO contents using the following command:
$ isoinfo -i /dev/mapper/<your-vcd-device-path> -l
-
-
Wait for the everRun system to synchronize the VCD across all nodes.
-
-
Import the VM using the REST API. You can submit the import request using any HTTP client, such as Swagger™, which is a suite of tools for the OpenAPI Specification. For more information, see REST API.
For example, to execute the API call:
-
Open Swagger at https://<system IP or domain>:8888/restapi/swagger-ui/index.html#/.
-
Navigate to the section VMImport Api, then to /v2/import/importvm. This is the end-point to import a VM from an OVF or OVA file.
-
Click Try it out and submit the request with the following required parameters:
-
vm-name — Name to assign to the imported VM.
-
remote-type — Type of remote connection or resource. Must be vcd for VCD-based import.
-
vcd-name — Name of the VCD you uploaded.
-
network — Network name.
The following example includes all required parameters for a VCD-based OVF file import. Although certain parameters (such as file-name and remote-dir) are ignored for VCD imports, the request schema requires them, so placeholder values must be provided. See the Swagger documentation for details.
{
"vm-name": "centos76-vhd",
"file-name": "string",
"remote-type": "vcd",
"port": "string",
"remote-dir": "string",
"vcd-name": "centos76-vhd",
"virtual-cpus": 0,
"memory": 0,
"destination": "string",
"availability-level": "HA",
"preferred-node": "string",
"network": ["network0"]
} -
-
After you submit the request, the system automatically:
-
Resolves the VCD name to its internal block device path
-
Mounts the VCD in read-only mode
-
Locates and validates the virtualization files inside
-
Parses the OVF or OVA file and imports the VM
-
Cleans up (unmounts and removes temporary directories)