| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 3 | <head> |
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 5 | <meta http-equiv="Content-Style-Type" content="text/css" /> |
|---|
| 6 | <meta name="generator" content="pandoc" /> |
|---|
| 7 | <title>Setting up the PCs for the NMM classes</title> |
|---|
| 8 | <style type="text/css">code{white-space: pre;}</style> |
|---|
| 9 | <link rel="stylesheet" href="../../style.css" type="text/css" /> |
|---|
| 10 | </head> |
|---|
| 11 | <body> |
|---|
| 12 | <div id="header"> |
|---|
| 13 | <h1 class="title">Setting up the PCs for the NMM classes</h1> |
|---|
| 14 | </div> |
|---|
| 15 | <div id="TOC"> |
|---|
| 16 | <ul> |
|---|
| 17 | <li><a href="#lets-clone-some-pcs"><span class="toc-section-number">1</span> Let's clone some PCs!</a><ul> |
|---|
| 18 | <li><a href="#update-your-workshop-kit-repo-to-be-safe"><span class="toc-section-number">1.1</span> Update your workshop-kit repo, to be safe</a></li> |
|---|
| 19 | <li><a href="#check-you-have-a-gold-vm-image-built."><span class="toc-section-number">1.2</span> Check you have a <code>gold</code> VM image built.</a></li> |
|---|
| 20 | <li><a href="#lets-clone-some-vms"><span class="toc-section-number">1.3</span> Let's clone some VMs!</a></li> |
|---|
| 21 | <li><a href="#start-the-vms"><span class="toc-section-number">1.4</span> Start the VMs</a></li> |
|---|
| 22 | <li><a href="#ping-the-pcs"><span class="toc-section-number">1.5</span> Ping the PCs</a></li> |
|---|
| 23 | <li><a href="#connectivity-test"><span class="toc-section-number">1.6</span> Connectivity test</a></li> |
|---|
| 24 | </ul></li> |
|---|
| 25 | </ul> |
|---|
| 26 | </div> |
|---|
| 27 | <h1 id="lets-clone-some-pcs"><a href="#lets-clone-some-pcs"><span class="header-section-number">1</span> Let's clone some PCs!</a></h1> |
|---|
| 28 | <h2 id="update-your-workshop-kit-repo-to-be-safe"><a href="#update-your-workshop-kit-repo-to-be-safe"><span class="header-section-number">1.1</span> Update your workshop-kit repo, to be safe</a></h2> |
|---|
| 29 | <pre><code>cd /home/nsrc/workshop-kit |
|---|
| 30 | git pull</code></pre> |
|---|
| 31 | <h2 id="check-you-have-a-gold-vm-image-built."><a href="#check-you-have-a-gold-vm-image-built."><span class="header-section-number">1.2</span> Check you have a <code>gold</code> VM image built.</a></h2> |
|---|
| 32 | <p>First, make sure you have at least one <code>gold</code> image built... If it's not called <code>gold</code> but <code>gold2</code> or <code>gold3</code>, then use that.</p> |
|---|
| 33 | <pre><code>virsh list --all</code></pre> |
|---|
| 34 | <p>If the <code>gold</code> is <em>not</em> called <code>gold</code>, but, say, <code>gold3</code>, then you will need to edit the file /home/nsrc/workshop-kit/scripts/cloneall-nmm.sh and change these lines:</p> |
|---|
| 35 | <pre><code>img_name1=gold.ws.nsrc.org |
|---|
| 36 | img_name2=gold.ws.nsrc.org</code></pre> |
|---|
| 37 | <p>To this:</p> |
|---|
| 38 | <pre><code>img_name1=NAME_OF_GOLD.ws.nsrc.org |
|---|
| 39 | img_name2=NAME_OF_GOLD.ws.nsrc.org</code></pre> |
|---|
| 40 | <p><em>NOTE:</em> If you do not have at least a <code>gold</code> image, you will need to build one with vmbuilder.</p> |
|---|
| 41 | <h2 id="lets-clone-some-vms"><a href="#lets-clone-some-vms"><span class="header-section-number">1.3</span> Let's clone some VMs!</a></h2> |
|---|
| 42 | <p>Go into the directory /home/nsrc/workshop-kit/scripts/, and run the cloneall-nmm.sh:</p> |
|---|
| 43 | <pre><code>cd /home/nsrc/workshop-kit/scripts/ |
|---|
| 44 | sudo ./cloneall-nmm.sh</code></pre> |
|---|
| 45 | <p>You should see a lot of output, as the clone scripts first try and move any previous PCs out of the way, then clones the <code>gold</code> (or whatever it is called on your server) to the individual PC names (1 - 36).</p> |
|---|
| 46 | <p>If everything goes well, you should be able to type <code>virsh list --all</code> and see:</p> |
|---|
| 47 | <pre><code> Id Name State |
|---|
| 48 | ---------------------------------- |
|---|
| 49 | ... |
|---|
| 50 | - pc1.ws.nsrc.org shut off |
|---|
| 51 | - pc10.ws.nsrc.org shut off |
|---|
| 52 | - pc11.ws.nsrc.org shut off |
|---|
| 53 | - pc12.ws.nsrc.org shut off |
|---|
| 54 | - pc13.ws.nsrc.org shut off |
|---|
| 55 | - pc14.ws.nsrc.org shut off |
|---|
| 56 | - pc15.ws.nsrc.org shut off |
|---|
| 57 | - pc16.ws.nsrc.org shut off |
|---|
| 58 | ...</code></pre> |
|---|
| 59 | <h2 id="start-the-vms"><a href="#start-the-vms"><span class="header-section-number">1.4</span> Start the VMs</a></h2> |
|---|
| 60 | <p>Time to start all those PCs!</p> |
|---|
| 61 | <p>The easiest way:</p> |
|---|
| 62 | <pre><code>for num in {1..36} |
|---|
| 63 | do |
|---|
| 64 | virsh start pc$num.ws.nsrc.org |
|---|
| 65 | done</code></pre> |
|---|
| 66 | <p>You should see:</p> |
|---|
| 67 | <pre><code>Domain pc1.ws.nsrc.org started |
|---|
| 68 | Domain pc2.ws.nsrc.org started |
|---|
| 69 | Domain pc3.ws.nsrc.org started |
|---|
| 70 | ...</code></pre> |
|---|
| 71 | <h2 id="ping-the-pcs"><a href="#ping-the-pcs"><span class="header-section-number">1.5</span> Ping the PCs</a></h2> |
|---|
| 72 | <p>Wait a few minutes, then try to ping one of the PCs:</p> |
|---|
| 73 | <pre><code>ping pc1.ws.nsrc.org |
|---|
| 74 | ping pc5.ws.nsrc.org |
|---|
| 75 | ping pc9.ws.nsrc.org |
|---|
| 76 | ...</code></pre> |
|---|
| 77 | <p>You can try and ping the first PC in every group (1-4, 5-8, 9-12, etc...).</p> |
|---|
| 78 | <p>Do they answer ?</p> |
|---|
| 79 | <p>How do you think the correct IP address was given to each of these PCs ? Remember, we cloned the gold image, which means all machines were identical.</p> |
|---|
| 80 | <p>How does it work ?</p> |
|---|
| 81 | <p>Note: if the PCs do not answer, you can always log on to them using the <code>virsh console</code> command, for instance:</p> |
|---|
| 82 | <pre><code>virsh console pcX.ws.nsrc.org</code></pre> |
|---|
| 83 | <p>You can then log in as the <code>sysadm</code> user and the password you have learned in class. Run <code>ifconfig</code> to check which IP, if any, the PC has received.</p> |
|---|
| 84 | <h2 id="connectivity-test"><a href="#connectivity-test"><span class="header-section-number">1.6</span> Connectivity test</a></h2> |
|---|
| 85 | <p>Now, try and ssh into one of the PCs as the <code>sysadm</code> user:</p> |
|---|
| 86 | <pre><code>ssh sysadm@pcX.ws.nsrc.org</code></pre> |
|---|
| 87 | <p>From there:</p> |
|---|
| 88 | <ul> |
|---|
| 89 | <li><p>ping one of the other PCs behind one of the other routers (so, if you're on pc1.ws.nsrc.org, try and ping pc5.ws.nsrc.org, for example)</p></li> |
|---|
| 90 | <li><p><code>traceroute -n</code> to one of the other PCs</p></li> |
|---|
| 91 | </ul> |
|---|
| 92 | <p>What do you observe ?</p> |
|---|
| 93 | </body> |
|---|
| 94 | </html> |
|---|