@alejo wrote:
Summary
This post will guide you with steps needed to deploy a cloud instance of VIRL to packet.net without having VIRL already installed. Make sure you have already followed all the pre-requisite steps needed before you attempt to deploy your cloud instance.
For more information please take a look at our announcement thread!Why use this method
You may or may not be new to VIRL, but you may be looking to keep the initial cost down. Or you may not have hardware powerful enough to run large real world topologies. This method gives you direct access to a powerful server where you can run VIRL (bare-metal) and test large simulations without the need of a local VIRL instance. If you do not already own a VMWare product to run VIRL, and you rather not purchase another application then this method is for you.
Before we begin
You may need to install a couple of applications, but don't worry these are free of charge
- Install the following:
- VirtualBox (Windows, Mac or Linux) or
- Vmware AppCatalyst (Mac ONLY!)
- Vagrant (Mac, Linux)
- Vagrant 1.7.4 (Windows) (Note: do not use 1.8.x) Reboot will be required
- SSH client such as PuTTY (recommended) (Windows Only)
- You will also need a Git client for the initial download of our files. If you are familiar with Git, just clone from the URL provided. If you are not, then I would recommend to download and install SmartGit.
- SmartGit (On initial launch, you can chose to skip the log in)
- From menu, click on Repository > Clone
- Repository URL: https://github.com/Snergster/virl_boxcutter (take all the defaults and choose local path directory)
Getting started
See it done!
Locate or download your VIRL license file and it keep it handy. We will need it during the installation.
Make sure your Vagrant plugin is up to date for your appropriate platform by running the following commandFor VirtualBox users:
vagrant plugin install virtualbox
For VMWare AppCatalyst users:
vagrant plugin install vmware_appcatalyst
Attention: Please use notepad (Windows) or TextEdit (Mac) when editing configuration files
- Log into your packet.net account
- Create an API key
- Navigate to your local Git repository
- example:
C:\Users\<username>\Documents\GitHub\virl_boxcutter
- Copy your VIRL License file (e.g.
xxxxxxxx.virl.info.pem
) tovirl_boxcutter\salt
directory in your local Git repository- Rename the copied license file to
minion.pem
(Windows users: make sure that your Windows explorer settings are set to show file name extensions)- From the
virl_boxcutter
directory, make a copy ofid.conf.orig
and rename itid.conf
- Open the newly created
id.conf
file with a text editor
- Change the id: field to your license ID (the
xxxxxxxx
part ofxxxxxxxx.virl.info.pem
)- Change the append_domain: field to the ending of your license file. If your license file has en ending of
virl30.info.pem
, then you would entervirl30.info
in theappend_domain
field. Save the changes and close the file- From the
virl_boxcutter
directory, make a copy ofsettings.tf.orig
and rename itsettings.tf
- Open the newly created
settings.tf
file with a text editor
- Replace
"bad_api_key"
with your API key from https://app.packet.net/portal#/api-keys- (Optional) you may adjust
"packet_machine_type"
or"dead_mans_timer"
as needed.<needs ref. link>
- Open your terminal application or a command prompt if you are on Windows
- Change directory to your local Git repository
cd Documents\GitHub\virl_boxcutter
- type:
vagrant up
be patient while the system downloads the VIRL BoxCutter virtual machine, configures and starts it. This will take a few minutes to complete.
Once completed, type the following command to connect to your BoxCutter virtual machine
vagrant ssh
Windows Users, you will most likely get an output similar to this:
C:\Users\<user>\Documents\GitHub\virl_boxcutter> vagrant ssh
`
'ssh' executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:
Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Users/<user>/Documents/GitHub/virl_boxcutter/.vagrant/machines/default/virtualbox/private_keyUsing the
Host
andPort
information above, open PuTTY or you SSH client and connect to your BoxCutter virtual machine. Username and password;vagrant and vagrant
Once logged in to your BoxCutter virtual machine change directory to
virl_packet
cd virl_packet
- (optional) Edit the file
password.tf
to adjust the passwords to suit your needs. Just stick to numbers and letters for now please!- Review the
Disclaimer.txt
file for operating rules.- If this is not your first launch of VIRL on Packet, log into to https://app.packet.net and click
Manage
. You need to ensure that there are no active projects present.
- If there are projects listed:
Click on the name of your project listed
Select "Settings" tab
Scroll to the bottom of the page and click on the button to 'Delete This Project'- From
virl_packet
type the following commands:
terraform plan .
(don't forget the 'dot')terraform apply .
(don't forget the 'dot')
NOTE: The above command initiates the deployment of your VIRL server on Packet. This process typically takes about 30min to complete. Please be patient and wait for the login credentials.
Connecting to your Packet Server:
(See it done -- link coming soon)
Your new bare-metal server is provisioned securely. In order to access your server you will need to establish an OpenVPN tunnel from your computer to your Packet server.Take a look at this post for more detail on installing OpenVPN
- Install the OpenVPN client appropriate for your system.
- You will find the file 'client.ovpn' under
/home/vagrant/virl_packet
- The
client.ovpn
file can be copied out to your local box usging this command:
cp client.ovpn /vagrant/
- Move the
client.ovpn
file toC:\Program Files\OpenVPN\config
directory (Windows)- Launch OpenVPN GUI and start the tunnel to connect
- Once the tunnel is connected, open a browser to http://172.16.11.254
- When using VM Maestro don't forget to change the connection profile to point to your Packet server; http://172.16.11.254
- If you do not have VM Maestro client installed, you will need to log into UWM and then navigate to VIRL Server > VIRL Software; then select the appropriate VM Maestro version and click "Start installation"
- Once complete, you can download the client from
http://172.16.11.254/download/
NOTE: Your uwmadmin and guest passwords are in
/home/vagrant/virl_packet/passwords.tf
file. You may also recall them by running the commandterraform show
.
Terminating your Packet server
When you're ready to terminate your Packet VIRL server, run the following command from your BoxCutter VM.
terraform destroy .
exit
(closes SSH session to BoxCutter VM)Next:
- Log in to the Packet.net portal
- Review the 'Manage' tab to confirm that the project and server instance has been deleted.
- If there are projects or servers still listed:
Click on the name of the project listed
Under "Servers" tab if a server is listed, click on the "Select Action" dropdown; select "Delete" and click "Apply"
Select "Settings" tab
Scroll to the bottom of the page and click on the button to 'Delete This Project'- Review the 'SSH Keys' tab and remove any ssh keys that are registered (If any)
Terminating your BoxCutter virtual machine
To terminate your 'virl_boxcutter' VM type the following command from you local command prompt or terminal:
- 'vagrant halt`
To start up again, repeat the process starting with step 11 under "Getting Started".
Posts: 1
Participants: 1