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

  1. Add the clusters containing the desired virtual machines as compute clusters in your VMware Integrated OpenStack deployment.
  2. Connect the virtual machine to a Neutron network.
    You can use a provider network or a tenant network for this procedure.
    1. In the vSphere Client, open the Hosts and Clusters view.
    2. Right-click each virtual machine that you want to import and select Edit Settings....
    3. From the drop-down list next to the network adapter, select the Neutron network that you want to use.
    4. Expand the network adapter settings and record its MAC address.
  3. Create a temporary opaque network for the virtual machine.
    • For NSX-T 2.5, you create a Logical Switch. See Create a Logical Switch to add a switch, then perform the following steps to obtain the logical switch ID.
      1. In the Logical Switch column, cllick the name of the switch that you created.
      2. Record the ID of the switch as displayed in the Overview column.
    • For NSX-T 3.0, you create a segment. See Add a Segment and record the name of the segment you added.
  4. Log in to the Integrated OpenStack Manager as the root user.
    ssh root@mgmt-server-ip
  5. Edit the Nova compute configuration.
    viocli update nova-compute
  6. In the vmware section, add the import_net_id parameter and set its value to the ID of the switch or the name of the segment that you added in Step 3.
  7. 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.
  8. Open the toolbox and set the password for the admin account.
    toolbox
    export OS_PASSWORD=admin-account-password
  9. 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.

  10. 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
  11. 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.