You can import virtual machines from vSphere into your VMware Integrated OpenStack deployment and manage them like OpenStack instances.
This procedure applies to deployments with NSX-T Data Center networking. For VDS or NSX Data Center for vSphere deployments, see Import Virtual Machines into VMware Integrated OpenStack with NSX Data Center for vSphere.
The following conditions apply to imported virtual machines:
- If a virtual machine has multiple disks, the disks are imported as Cinder volumes.
- After a virtual machine with a specific network backing is imported, the same network cannot be imported to a different project. If you want to use a network for multiple projects, configure it as a shared network.
You import virtual machines using the Data Center Command-Line Interface (DCLI) in the Integrated OpenStack Manager toolbox.
Prerequisites
Verify that the virtual machines that you want to import are in the same vCenter Server instance.
Procedure
- Add the clusters containing the desired virtual machines as compute clusters in your VMware Integrated OpenStack deployment.
- Connect the virtual machine to a Neutron network.
You can use a provider network or a tenant network for this procedure.
- In the vSphere Client, open the Hosts and Clusters view.
- Right-click each virtual machine that you want to import and select Edit Settings....
- From the drop-down list next to the network adapter, select the Neutron network that you want to use.
- Expand the network adapter settings and record its MAC address.
- Create a temporary opaque network for the virtual machine.
- In NSX Manager, select and click Add.
- Enter a name for the switch and select the overlay transport zone.
- Click Add.
- In the Logical Switch column, click the name of the switch that you created.
- Record the ID of the switch as displayed in the Overview column.
- Log in to the Integrated OpenStack Manager as the
root
user.
- Edit the Nova compute configuration.
viocli update nova-compute
- In the vmware section, add the import_net_id parameter and set its value to the ID of the switch that you created.
- If you want to prevent imported virtual machines from being relocated or renamed, add the import_vm_relocate parameter and set its value to
false
.
- Open the toolbox and set the password for the
admin
account.
toolbox
export OS_PASSWORD=admin-account-password
- Create a Neutron port that uses the MAC address of the virtual machine's network adapter.
neutron port-create network --name port --tenant-id project-id --mac-address vm-mac [--fixed-ip ip_address=vm-ip]
Option |
Description |
network |
Enter the name of the Neutron network to which you connected the virtual machine. |
--name |
Enter a name for the port. |
--tenant-id |
Specify the UUID of the project for which to create the port. |
--mac-address |
Enter the MAC address of the virtual machine's network adapter recorded in Step 2d. |
--fixed-ip |
Enter the IP address of the virtual machine. If the virtual machine does not have an IP address or you do not want to retain the existing IP address, you can omit this parameter. |
- Connect to the VMware Integrated OpenStack vAPI endpoint.
The endpoint is located at the private OpenStack endpoint of your deployment.
dcli +server http://internal-vip:9449/api +i
- Import the virtual machine into VMware Integrated OpenStack.
com vmware vio vm unmanaged importvm --vm vm-moid --nic-net-id network-uuid --nic-port-id port-uuid [--tenant project-name] [--root-disk root-disk-path]
Option |
Description |
--vm |
Enter the managed object identifier (MOID) of the virtual machine that you want to import. You can view the MOIDs of all unmanaged virtual machines by running the com vmware vio vm unmanaged list command. |
--nic-net-id |
Enter the UUID of the Neutron network to which you connected the virtual machine. |
--nic-port-id |
Enter the UUID of the port that you created for the virtual machine. |
--tenant |
Specify the OpenStack project into which you want to import the virtual machine. If you do not include this parameter, the import_service project is used by default. |
--root-disk |
For a virtual machine with multiple disks, specify the root disk datastore path in the following format: --root-disk '[datastore1] dir/disk_1.vmdk' |
Note: When you execute a command, DCLI prompts you to enter the administrator credentials for your
vCenter Server instance. You can save these credentials to avoid entering your username and password every time.
Results
The specified virtual machine is imported into your OpenStack deployment and can be managed as an OpenStack instance.