Merge "Cluster sanity test using openflow plugin"
[integration/test.git] / test / tools / VM_Tool / README.md
1 ## Integration Team Tools VM
2
3 This Vagrantfile provides VMs with many of the tools used by the OpenDaylight Integration Team pre-installed and configured. It's meant to serve as a known-working, reproducible, clearly defined environment for consuming them.
4
5 ### Dependencies
6
7 #### Installing Vagrant
8
9 If you don't have Vagrant installed, head over to the [Vagrant Downloads](https://www.vagrantup.com/downloads.html) page and grab the latest version for your OS. Fedora/RHEL/CentOS folks need the RPM package, Ubuntu/Debian folks need the DEB package. Note that Vagrant also supports Windows and OSX.
10
11 Assuming you're on Fedora/RHEL/CentOS, find the .rpm file you just downloaded and install it:
12
13 ```ShellSession
14 sudo rpm -i <name of rpm>
15 ```
16
17 Vagrant uses various "providers" for virtualization support. By default, it uses VirtualBox. If you don't have VirtualBox installed, you'll see an error message when you try to `vagrant up` anything. Install VirtualBox (Fedora/RHEL/CentOS):
18
19 ```ShellSession
20 $ sudo yum install VirtualBox kmod-VirtualBox -y
21 ```
22
23 You may need to restart your system, or at least `systemctl restart systemd-modules-load.service`. If you see Kernel-related errors, try that.
24
25 #### Installing Required Gems
26
27 We use Bundler to make gem management trivial.
28
29 ```ShellSession
30 $ gem install bundler
31 $ bundle install
32 ```
33
34 Among other things, this will provide `librarian-puppet`, which is required for the next section.
35
36 #### Installing Required Puppet Modules
37
38 Once you've installed `librarian-puppet` through Bundler (as described above), you can use it to install our Puppet module dependences.
39
40 ```ShellSession
41 $ librarian-puppet install
42 $ ls modules
43 archive  java  opendaylight  stdlib
44 ```
45
46 ### Configuration
47
48 To configure the RAM and CPU resources to be used by the tools boxes, adjust the variables at the top of the Vagrantfile.
49
50 ```ruby
51 # Set memory value (MB) and number of CPU cores here
52 $MEMORY = "2048"
53 $CPU = "2"
54 ```
55
56 To configure the ODL install, adjust the params passed to the [OpenDaylight Puppet module](https://github.com/dfarrell07/puppet-opendaylight) in `manifests/odl_install.pp`.
57
58 By default, the newest ODL stable release will be installed via its RPM.
59
60 ### Common Vagrant commands
61
62 Since this Vagrantfile defines a multi-machine environment, it's mandatory to give the name of the box for most Vagrant command. For example, `vagrant up` should be `vagrant up <name of box>`.
63
64 #### Gathering information
65
66 Use `vagrant status` to see the supported boxes and their current status.
67
68 ```ShellSession
69 $ vagrant status
70 Current machine states:
71
72 fedora                    not created (virtualbox)
73 ubuntu                    not created (virtualbox)
74 ```
75
76 #### Starting boxes
77
78 To start a tools VM:
79
80 ```ShellSession
81 $ vagrant up <name of box>
82 ```
83
84 For example, to start the Fedora tools VM:
85
86 ```ShellSession
87 $ vagrant up fedora
88 ```
89
90 #### Connecting to boxes
91
92 To get a shell on a tools VM:
93
94 ```ShellSession
95 $ vagrant ssh <name of box>
96 ```
97
98 For example, to connect to the Fedora tools VM:
99
100 ```ShellSession
101 $ vagrant ssh fedora
102 [vagrant@tools-fedora ~]$
103 ```
104
105 #### Cleaning up boxes
106
107 Suspending a tools VM will allow you to re-access it quickly.
108
109 ```ShellSession
110 $ vagrant suspend <name of box>
111 ```
112
113 To totally remove a VM:
114
115 ```ShellSession
116 $ vagrant destroy -f <name of box>
117 ```