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.
Imported virtual machines become OpenStack instances but remain distinct.
- 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 VMs using the Data Center Command-Line Interface (DCLI) on the OpenStack Management Server.
Verify that the virtual machines that you want to import are in the same vCenter Server instance.
- In vSphere, add the cluster containing the desired virtual machine as a compute cluster in your VMware Integrated OpenStack deployment. For instructions, see Add Compute Clusters to Your 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 OpenStack Management Server as
- If your deployment is not using a custom.yml file, copy the template custom.yml file to the /opt/vmware/vio/custom directory.
sudo mkdir -p /opt/vmware/vio/custom sudo cp /var/lib/vio/ansible/custom/custom.yml.sample /opt/vmware/vio/custom/custom.yml
- Open the /opt/vmware/vio/custom/custom.yml file in a text editor.
- Uncomment the nova_import_net_id parameter and set its value to the ID of the switch that you created in Step 3.
- If you want to prevent imported virtual machines from being relocated or renamed, uncomment the nova_import_vm_relocate parameter and set its value to
- Deploy the updated configuration.
sudo viocli deployment configure
Deploying the configuration briefly interrupts OpenStack services.
- Switch to the
rootuser and load the cloud administrator credentials file.
sudo su - source ~/cloudadmin.rc
- 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.
Enter a name for the port.
Specify the UUID of the project for which to create the port.
Enter the MAC address of the virtual machine's network adapter recorded in Step 2d.
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.
dcli +server https://mgmt-server-ip:9449/api +i
If you cannot connect to the server, see DCLI Cannot Connect to Server.
- 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.
Enter the UUID of the Neutron network to which you connected the virtual machine.
Enter the UUID of the port that you created for the virtual machine.
Specify the OpenStack project into which you want to import the virtual machine.
If you do not include this parameter, the
import_serviceproject is used by default.
For a virtual machine with multiple disks, specify the root disk datastore path in the following format: --root-disk '[datastore1] foo/foo_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.