4.3.5. Scripted bulk v2v process
For bulk import scenarios, it is advantageous to be able to perform the scripted v2v process from a single host. Remote procedure calls to the Red Hat Enterprise Virtualization Manager can be made using the REST API. This enables a single script running on a single Linux host to perform both steps of the v2v process. Figure 4.5, “Scripted bulk v2v process” illustrates the steps performed by the script.
Figure 4.5. Scripted bulk v2v process
The scripted bulk v2v process involves the following steps, as shown in Figure 4.5, “Scripted bulk v2v process”:
- The virtual machine image is retrieved from the source hypervisor.
- The virtual machine image is packaged and copied to the export storage domain.
- A remote procedure call is made to the Red Hat Enterprise Virtualization Manager, telling it to import the virtual machine.
- The Manager imports the virtual machine from the export storage domain.
To configure and run the scripted bulk v2v process:
Procedure 4.9. Configuring and running the scripted bulk v2v process
- Ensure the REST API is enabled on the Red Hat Enterprise Virtualization Manager, and it is accessible from the Linux host running the v2v process. For more information about the REST API, see the Red Hat Enterprise Virtualization REST API Guide Guide.
- On the Linux host, create the file
v2v.sh
with the following contents. Ensure you edit the script to contain appropriate values for your environment.Example 4.5. Single host v2v script
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Use thePOST
method to export virtual machines with the REST API. For more information about using the REST API, see the Red Hat Enterprise Virtualization REST API Guide. - Run the
v2v.sh
script. It can take several hours to convert and import a large number of virtual machines.