The Contrail-Builder VM acts as a the installer and proxy for any and all connectivity to/from the Contrail-AIO VM.
Prep
-
Obtain a routable/networked IP address (RFC1918) that can connect to the Internet to download updates, packages and applications. This IP is for the Contrail-Builder VM and gets assigned to
eth0/vnic1
.Note
eth1/vnic2
is statically assigned for the build and setup in the next step. -
Create a new port-group on the ESXi server. This port-group should be a non-routed port-group that will only be used to connect the Contrail-Builder and Contrail-AOI VMs to each other.
-
Enable the "Guest IP Hack" on the ESXi server by connecting via SSH and running this command from the cli;
esxcli system settings advanced set -o /Net/GuestIPHack -i 1
More information is available here: https://www.packer.io/docs/builders/vmware-iso.html -
Allow VNC through the ESXi firewall:
-
chmod 644 /etc/vmware/firewall/service.xml
-
chmod +t /etc/vmware/firewall/service.xml
-
Then append the range of ports you want open to the end of the file:
<service id="1000">
<id>packer-vnc</id>
<rule id="0000">
<direction>inbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>
<begin>5900</begin>
<end>6000</end>
</port>
</rule>
<enabled>true</enabled>
<required>true</required>
</service>
4. Restore the Firewall permissions:
chmod 444 /etc/vmware/firewall/service.xml
esxcli network firewall refresh
-
Import the Contrail-Builder.ova file
-
Power on the VM
-
Log into the VM's console with
root
credentials list below. -
Change the IP address of
eth0
(obtained in Prep step 1) in the/etc/network/interfaces
file and save:iface eth0 inet static address 10.180.21.79 <--CHANGE_ME netmask 255.255.255.0 <--CHANGE_ME network 10.180.21.0 <--CHANGE_ME broadcast 10.180.21.255 <--CHANGE_ME gateway 10.180.21.254 <--CHANGE_ME #dns-* options are implemented by the resolvconf package, if installed dns-nameservers 10.180.21.21 10.180.21.22 <--CHANGE_ME dns-search lab.lab
-
Reboot the VM
-
You can connect as root via ssh or the console into the Builder VM.
-
When editing this file, search for the string CHANGE_ME and change them to your appropriate information. Edit the following lines in the
/Builder/Packer/variables.json
file and save:remote_host (ESXi server) remote_datestore (on the ESXi server) remote_username (ESXi user) remote_password (ESXi password) ethernet0.networkName (vSwitch name on ESXi)
-
Start the build process by running:
cd /Builder/Packer
packer build -var-file=variables.json Contrail-AIO.json
-
This should start and complete the automatic Packer build process. Depending on the resources of the ESXi server, it should take 60-90 minutes from start to finish. You will see the output from Packer to builder cli while the builder scripts run. At a high level it does the following:
- Contrail-Builder runs in packer to create the VM itself on the ESXi server
- Downloads the Ubuntu server ISO and calls a pre-seed config file to build and configure the OS.
- Runs Ansible plays from a playbook to setup OpenStack and Contrail
- Upon successful completion the VM will gracefully shutdown.
-
Power up and log into the Contrail-AIO VM console or ssh.
-
Login and run the command
sudo contrail-status
. This will give you insight on all the services associated with contrail, all of which should show active.NOTE All services typically take ~5 minutes to start/restart. Additionally, if you only see 3-4 services listed, it means the install didn't fully complete. You can manually re-run the installer from inside the VM without worry;
cd /opt/contrail/utils
then runfab setup_all
.- If
contrail-status
returns acommand not found
, or something similar you will need to run; cd /opt/contrail/utils
and thefab install_contrail
. Once that is complete, runfab setup_all
-
You should now be able to access the Contrail and OpenStack GUIs:
GUI access
-
OpenStack = http://IP_address_YOU_provided_in_Step_5/horizon
-
Example http://10.10.10.10./horizon
-
Contrail = https://IP_address_YOU_provided_in_Step_5:8143
-
Example https://10.10.10.10:8143
User Crendentials - CLI username/password
- juniper/juniper123
- root/juniper123
User Credentials - OpenStack and Contrail GUI
- admin/juniper123