...
This tutorial describes how to capture a remote virtual machine that VM hat is connected to a network not managed by Abiquo.
...
To capture a remote virtual machine first of all you need a physical machine from which you will capture the virtual machineVM, so create the datacenter and rack, then add the physical machine.
Select Retrieve virtual machines. (Persistent virtual machines VMs will not be retrieved because their system disks are located on external volumes. Virtual machines VMs that are already registered in Abiquo will not be retrieved).
Screenshot: A VM that has been imported is marked with the symbol.
Then you need to create the networks where the captured machine will be assigned. For example, you may need to create a public or external network in the datacenter with the same specification as the network that the NICs on the virtual machine are attached to (VLAN tag, network address, available IPs). And you should create the required IPs in Abiquo.
...
The GUI will then ask you for the virtual appliance to store the virtual machineVM. Now select your virtual appliance created in the virtual datacenter with the network addresses purchased. If you didn't create a virtual appliance earlier, you can do so now by clicking the + button.
...
Accept the capture and the remote virtual machine VM will be added to the virtual appliance and managed by Abiquo. This example showed the capture of a virtual machine VM with two NICs and two hard disks and you can open the virtual machine VM configuration to view check them.
Using the API
You can capture a virtual machine using the API and once you get started, it's not such a daunting task as it might first seem! A good working knowledge of the Abiquo API is required, but as always, if you get stuck, you can always open your browser console and take a look at how the Abiquo UI does it!
...
First be sure to do the preparatory steps and obtain the information about the virtual machine VM and the environment that you will require to create the virtual machine VM object.
Before you begin:
- In Abiquo, determine the ID of:
- The enterprise the VM will be captured for
- The datacenter where it will be captured
- The physical machine (hypervisor) where it will be captured from
- In the hypervisor:
- Check the virtual machine VM name
- Check the network details including the VLAN tag
- In the virtual machine
- Check the IP addresses of the NICs
- In Abiquo, create the following and make a note of the IDs:
- The virtual datacenter that the VM will be captured into
- The networks that the VM will belong to
- The IP addresses for the VM in the networks
- The virtual appliance that the virtual machine VM will be captured into
To capture a VM using the API
- Retrieve the virtual appliance the VM will be captured into
- The POST to capture the virtual machine is made to the virtual machines URL of the virtual appliance.
- It's not really necessary to get the whole virtual appliance, but by doing so, you can validate the link and check that you have the right virtual appliance!
- The POST to capture the virtual machine is made to the virtual machines URL of the virtual appliance.
- Retrieve the virtual machine with resources from the hypervisor in Abiquo
- You will modify this virtualmachineflat object to create the request payload for the POST request
- Retrieve network interfaces for configuration
- You will need the network link and the IP address, which will be included in the virtualmachineflat object
- Modify the virtualmachineflat object
- Post the virtualmachineflat object to the virtual machines URL of the virtual appliance
Retrieve virtual appliance
...
Retrieve all the virtual machines from the hypervisor, using sync=true. Identify the required virtual machineVM. Obtain a flat representation of the virtual machine VM that includes the disks and network interface details (MAC address and sequence number).
...