THIS DOCUMENT IS FOR USERS WHO WANT TO RUN 'VIRL on PACKET' DIRECTLY FROM THEIR WORKSTATION/LAPTOP. YOU MUST HAVE A VALID VIRL LICENSE KEY. IF YOU WISH TO RUN 'VIRL on PACKET' FROM YOUR VIRL SERVER, PLEASE SEE 'https://github.com/Snergster/virl_packet/blob/master/salt.README.md'
Virl_boxcutter is a self-contained 'launcher' virtual machine image, used to bring up a VIRL Server on the Packet.net platform. You do NOT need to have VIRL installed on your workstation or laptop. The launcher uses Vagrant (from Hashicorp) to control the operation of the 'launcher VM'.
Vagrant offer free plugin support for Virtualbox and for Vmware AppCatalyst. Other plugins are provided at a cost.
register for a Packet.net account
Install either Virtualbox (https://www.virtualbox.org/wiki/Downloads) for Windows, Mac or Linux, or Vmware AppCatalyst (https://www.vmware.com/cloudnative/appcatalyst-download) for Mac.
Install Vagrant (https://www.vagrantup.com/downloads.html) for Mac or Linux.
WINDOWS USERS - please install Vagrant 1.7.4 from https://releases.hashicorp.com/vagrant/1.7.4/vagrant_1.7.4.msi. DO NOT INSTALL 1.8.x
You must ensure that you have installed the appropriate Vagrant plugin, using the command:
vagrant plugin install virtualbox
or
vagrant plugin install vagrant-vmware-appcatalyst
Install a Git client of your choice then 'clone' the repo at https://github.com/Snergster/virl_boxcutter
The virl_boxcutter directory will be created once the clone operation completes.
In the 'virl_boxcutter\salt' directory, copy the content of your VIRL license key (e.g. 'xxxxxxxx.virl.info.pem') into a file that MUST be called 'minion.pem'. MAKE SURE THAT YOU INCLUDE THE HEADER AND FOOTER OF THE FILE.
WINDOWS USERS - make sure that the file is NOT called 'minion.pem.txt'!!!
In the 'virl_boxcutter' directory, make a copy of the file 'id.conf.orig' and call it 'id.conf'.
Edit the 'id.conf' file. The 'id' field must be set to be the value 'xxxxxxxx' from your VIRL license key ('xxxxxxxx.virl.info.pem'). The 'append_domain' field must be set to the domain field from your VIRL license key. If your domain field is 'virl.info', then this should be put in the 'append_domain' field. If your domain field is 'virl30.info', then this should be put in the 'append_domain' field. Save the changes.
Make a copy of the 'settings.tf.orig' and call it 'settings.tf'.
Edit the 'settings.tf' file. Replace the packet_api 'default' field with your packet_api_key. You can also adjust the 'dead_mans_timer' value and the 'packet_machine_type' that will be used with the VIRL server is created. In addition, you can select where you want your VIRL server to be hosted from the available Packet.net data centers. EWR1 == New York, SJC1 == San Jose, CA, AMS1 == Amsterdam. Instructions in the settings.tf file will guide you to the changes that you need to make.
From a command window, go into the 'virl_boxcutter' directory and run the following command:
vagrant up
The system will now download the 'virl_boxcutter' VM and start the VM up. This will take some time to complete on its first download.
Once complete, use the command below to connect into the 'virl_boxcutter' VM
vagrant ssh
WINDOWS USERS - you must have an SSH client installed. Information from Vagrant will provide directions on how to connect to the 'virl_boxcutter' VM from your SSH client. If you are prompted for a password, the password is 'vagrant'.
Go into the 'virl_packet' directory using the command:
cd virl_packet
Edit the file 'password.tf' to adjust the passwords to suit your needs (stick to numbers and letters for now please)
Review the 'Disclaimer.txt' file for operating rules.
Before bringing up your VIRL server, log into to app.packet.net and click 'Manage'. You need to ensure that there are no active projects present. If there are active projects:
Run the command
terraform plan .
This will validate the terraform .tf file.
Run the command
terraform apply .
This will spin up your remote VIRL server on Packet.net and install the VIRL software stack. If this runs without errors, expect it to take ~30 minutes. When it completes, the system will report the IP address of your Remote VIRL server. Login using
ssh root@<ip address>
or ssh virl@<ip address>
NOTE - the VIRL server will reboot once the VIRL software has been installed. You must therefore wait until the reboot has completed before logging in.
To see more information about your Remote VIRL server, run the command
terraform show
The output will provided details of your Remote VIRL server instance.
The VIRL server is provisioned in a secure manner. To access the server, you must establish an OpenVPN tunnel to the server.
terraform apply .
command. cp client.ovpn /vagrant/
. The file is then available on your laptop in the directory from which you issued the command 'vagrant up'.NOTE - the VIRL server will reboot once the VIRL software has been installed. You must therefore wait until the reboot has completed before bringing up the OpenVPN tunnel.
With your OpenVPN tunnel up from your workstation or laptop, the VIRL server is available at http://172.16.11.254.
If using VM Maestro, you must set up the connection profile to point to 172.16.11.254
When you're ready to terminate your remote VIRL server instance, on your 'virl_boxcutter' VM, issue the command
terraform destroy .
Ensure that all projects are successfully terminated by logging into to app.packet.net and click 'Manage'. If there are active projects:
To terminate your 'virl_boxcutter' VM type the commands:
exit'
vagrant halt`
Log in to the Packet.net portal
To start up again, repeat step 12.
[NOTE] Your uwmadmin and guest passwords are in passwords.tf. If you can't remember them, this is where you can find them, or by running the command terraform show
.
Once your VIRL Server has come up, log in to the UWM interface as 'uwmadmin' using your password. Navigate to the 'VIRL Server/VIRL Software' tab and select the VM Maestro client package(s) that you'd like. Now press 'install'. The package will be installed on your VIRL server and will be available from http://172.16.11.254/download/
.
Terminate the instance using the command:
terraform destroy .
Log in to the Packet.net portal
[NOTE] a server can only be terminated on the Packet.net portal once the server's status is reported as 'green'. You may therefore need to wait for a few minutes in order for the server to reach this state.
When a VIRL server is initialised, a 'dead man's timer' value is set. The purpose of the timer is to avoid a server instance being left running on the platform for an indefinite period.
The timer value is set by default to four (4) hours and can be changed by modifying the 'dead mans timer' value in the settings.tf file before you start your server instance. The value you set will be applied each time you start up a server instance until you next modify the value.
If your server is running at the point where the timer expires, your server instance will be terminated automatically. Any information held on the server will be lost.
You are able to see when the timer will expire by logging in (via ssh) to the server instance and issuing the command sudo atq
. You can remove the timer, leaving the server to run indefinitely, by issuing the command sudo atrm 1
.