Moving a virtual machine from a Linux bridge to a NSX logical switch
book
Article ID: 320924
calendar_today
Updated On:
Products
VMware NSX
Issue/Introduction
This article provides information on how to move a virtual machine from a Linux bridge to a NSX logical switch.
Note: This article was written based on work done with Ubuntu 14.04 / 16.04.
Environment
VMware NSX-T
Resolution
Prerequisites:
NSX is installed and KVM hypervisor hosts are prepared for NSX. At least one logical switch is created.
VM is created on a KVM hypervisor and connected to an existing Linux bridge.
Steps:
Install the Ubuntu UUID package to generate UUIDs for logical ports. This can be done on any Ubuntu machine but in this example was done on the KVM hypervisor host with the command "apt-get -y install uuid".
List virtual machines running on the system with the "virsh list" command to determine the VM what will be connected to the logical switch.
Shutdown the VM that will be moved to the logical switch with the command.
Run the "uuid" command to generate a random UUID. Save this in a text file or in your copy/paste buffer for later use.
Edit the VM by running "virsh edit <vm-name>" where <vm-name is the name of the VM.
Find the section for the ethernet interface of the VM. Edit it to look similar to as follows. Note that the MAC will be the MAC of the VM and will be different. Also, the UUID after "interfaceid=" should be the UUID you saved in your copy/paste buffer. The <target dev=''/> also needs to be updated with your VM name.
Add the logical port in NSX. If using the GUI do the following:
Navigate to Switching --> <logical-switch-name> --> Related --> Ports --> Add
Name: <-- Name your port
Description: <-- Describe your port
Logical Switch: <-- Should be automatically set to the switch you edited.
Attachment Type: <-- VIF
Attachment ID: <-- Use the same UUID you used in the VM settings
Use "virsh start <vm-name>" to boot your VM and attach it to the NSX logical switch. You should now be able to send L2 traffic from this VM to other VMs on the same logical switch.