Ansible: Installing Ansible on Ubuntu 16.04 

Source: Ansible: Installing Ansible on Ubuntu 16.04 – Fabian Lee : Software Architect


NSX-T 2.4 on Ubuntu 16.04 KVM

Set Up KVM

Note The Geneve encapsulation protocol uses UDP port 6081. You must allow this port access in the firewall on the KVM host.

Install KVM and bridge utilities

apt-get install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virtinst virt-manager virt-viewer libguestfs-tools

Verify the hardware virtualization capability

cat /proc/cpuinfo | egrep "vmx|svm"

The output must contain vmx

Verify that the KVM module is installed

INFO: /dev/kvm exists
KVM acceleration can be used

For KVM to be used as a host for NSX Manager, prepare the bridge network, management interface, and NIC interfaces

Edit /etc/network/interfaces:

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet dhcp

auto br0

iface br0 inet static







 dns-search cqu.lab

 bridge_ports eth0

 bridge_stp off

 bridge_fd 0

 bridge_maxwait 0

Create a network definition XML file for the bridge. For example, create /tmp/bridge.xml with the following lines:



 <forward mode='bridge'/>

 <bridge name='br0'/>


Define and start the bridge network with the following commands:

sudo virsh net-define /tmp/bridge.xml

sudo virsh net-start bridge

sudo virsh net-autostart bridge

Verify the status of the bridge network with the following command:

sudo virsh net-list --all

Name                State                Autostart        Persistent


bridge                active                yes                yes

default                active                yes                yes

Restart networking service systemctl restart network or reboot the Linux server for the networking changes take effect.

Install NSX Manager on KVM

Download the NSX Manager QCOW2 image from My VMware

Copy it to the KVM machine that is going to run the NSX Manager using SCP or sync.

Add the currently logged in user as a libvirtd user:

adduser $USER libvirtd

In the same directory where you saved the QCOW2 image, create a file called guestinfo.xml and populate it with the NSX Manager VM’s properties.

For example:

<?xml version="1.0" encoding="UTF-8"?>






 <Property oe:key="nsx_cli_passwd_0" oe:value="<password>"/>

 <Property oe:key="nsx_cli_audit_passwd_0" oe:value="<password>"/>

 <Property oe:key="nsx_passwd_0" oe:value="<password>"/>

 <Property oe:key="nsx_hostname" oe:value="nsx-manager1"/>

 <Property oe:key="nsx_role" oe:value="nsx-manager nsxcontroller"/>

 <Property oe:key="nsx_isSSHEnabled" oe:value="True"/>

 <Property oe:key="nsx_allowSSHRootLogin" oe:value="True"/>

 <Property oe:key="nsx_dns1_0" oe:value=""/>

 <Property oe:key="nsx_ntp_0" oe:value=""/>

 <Property oe:key="nsx_domain_0" oe:value="cqu.lab"/>

 <Property oe:key="nsx_gateway_0" oe:value=""/>

 <Property oe:key="nsx_netmask_0" oe:value=""/>

 <Property oe:key="nsx_ip_0" oe:value=""/>



Use guestfish to write the guestinfo.xml file into the QCOW2 image.

Note After the guestinfo information is written into a QCOW2 image, the information cannot be overwritten.

sudo guestfish --rw -i -a nsx-unified-appliance- upload guestinfo.xml /config/guestinfo

Deploy the QCOW2 image with the virt-install command.

sudo virt-install --import --name nsx-manager1 --ram 16384 --vcpus 4 --network=bridge:br0,model=e1000 --disk path=/var/lib/libvirt/images/nsx-unified-appliance-,format=qcow2 --nographics

Starting install...

Domain installation still in progress. Waiting for installation to complete.

Verify that the NSX Manager is deployed.

virsh list --all

Id                Name                State


18                nsx-manager1        running

Open the NSX Manager console and log in.

virsh console 18

Connected to domain nsx-manager1

Escape character is ^]

nsx-manager1 login: admin


After the NSX Manager boots, log in to the CLI as admin and run the get interface eth0 command to verify that the IP address was applied as expected.

Run get services to verify that the services are running.

Verify that your NSX Manager has the required connectivity. Make sure that you can perform the following tasks.

   Ping your NSX Manager from another machine.

   The NSX Manager can ping its default gateway.

   The NSX Manager can ping the hypervisor hosts that are in the same network as the NSX Manager using the management interface.

   The NSX Manager can ping its DNS server and its NTP server.

   If you enabled SSH, make sure that you can SSH to your NSX Manager.

If connectivity is not established, make sure that the network adapter of the virtual appliance is in the proper network or VLAN.

Exit the KVM console.


From a browser, log in with admin privileges to an NSX Manager at https://<nsx-manager-ipaddress>.