Projet

Général

Profil

Installation Gateway dans nebula » Historique » Version 61

Klaas TJEBBES, 02/10/2014 16:14

1 47 Gilles Grandgérard
{{toc}}
2 47 Gilles Grandgérard
3 61 Klaas TJEBBES
http://dev-eole.ac-dijon.fr/projects/eole-ci-tests/wiki/ModeleReseaux
4 61 Klaas TJEBBES
5 50 Gilles Grandgérard
h1. A) Installation pour utilisation d'une gateway
6 3 Gilles Grandgérard
7 40 Gilles Grandgérard
h2. A.1) Récupération du dépot eole-ci-test
8 1 Gilles Grandgérard
9 4 Gilles Grandgérard
Faire :
10 4 Gilles Grandgérard
<pre>
11 29 Gérald Schwartzmann
git clone https://dev-eole.ac-dijon.fr/git/eole-ci-tests.git
12 4 Gilles Grandgérard
</pre>
13 1 Gilles Grandgérard
14 40 Gilles Grandgérard
h2. A.2) Ajout de la gateway dans le eole-ci-tests
15 1 Gilles Grandgérard
16 42 Gilles Grandgérard
il faut créer un script dans 'configuration/gateway/' dont le nom sera 'routeur_<user_nebula>.sh'. (Tips: copier un fichier existant !)
17 25 Gilles Grandgérard
Penser à mettre les droits d'execution.
18 1 Gilles Grandgérard
19 22 Gilles Grandgérard
<pre>
20 22 Gilles Grandgérard
IP_EOLE=<fin de l'Ip sur le reseau EOLE>
21 22 Gilles Grandgérard
</pre>
22 22 Gilles Grandgérard
23 26 Gilles Grandgérard
Voir : 
24 26 Gilles Grandgérard
* http://dev-eole.ac-dijon.fr/projects/eole-interne/wiki/Adressage_ip 
25 26 Gilles Grandgérard
* Attention à ce que l'adresse soit disponible 
26 1 Gilles Grandgérard
27 40 Gilles Grandgérard
h2. A.3) Ajout de la clef publique ssh dans eole-ci-tests/security/authorized_keys
28 1 Gilles Grandgérard
29 30 Gérald Schwartzmann
Les clefs publiques SSH présentes dans eole-ci-tests/security/authorized_keys sont automatiquement concatenées dans /root/.ssh/authorized_keys au 1er démarrage de la VM.
30 1 Gilles Grandgérard
L'acces a chaque VM peut se faire sans mot de passe.
31 1 Gilles Grandgérard
32 1 Gilles Grandgérard
Utiliser le nom 'user@hostname' pour votre fichier de cle.
33 1 Gilles Grandgérard
34 40 Gilles Grandgérard
h2. A.4) Commit
35 1 Gilles Grandgérard
36 1 Gilles Grandgérard
<pre>
37 31 Gérald Schwartzmann
git add -a
38 31 Gérald Schwartzmann
git commit -m "ajout de l'utisateur <user>"
39 1 Gilles Grandgérard
git push
40 1 Gilles Grandgérard
</pre>
41 1 Gilles Grandgérard
42 42 Gilles Grandgérard
h2. A.5) Publication de la clef et du fichier routeur
43 42 Gilles Grandgérard
44 42 Gilles Grandgérard
Attendre que Jenkins publie le commit vers les VM (15 minutes)
45 42 Gilles Grandgérard
46 42 Gilles Grandgérard
OU, faire :
47 52 Fabrice Barconnière
* Ouvrir votre navigateur, et Aller http://jenkins.eole.lan/view/Dev/job/git-clone-eole-ci-tests-to-all-vm/
48 42 Gilles Grandgérard
* Se connecter (compte smb.eole.lan)
49 42 Gilles Grandgérard
* Saisir le nom d'utilisateur et le mot de passe
50 54 Fabrice Barconnière
* Cliquer sur *Lancer un build*
51 42 Gilles Grandgérard
* Dans l"historique des builds" un build apparait. Cliquer sur le lien
52 42 Gilles Grandgérard
* Le message de commit 'git' doit apparaitre dans la sortie
53 26 Gilles Grandgérard
54 43 Gilles Grandgérard
h2. A.6) Initialiser les réseaux dans Nebula
55 1 Gilles Grandgérard
56 36 Gilles Grandgérard
* Ouvrir votre navigateur, et Aller http://jenkins.eole.lan/view/Dev/job/genere-modele-reseau-dans-nebula/build?delay=0sec
57 37 Gilles Grandgérard
* Se connecter (compte smb.eole.lan)
58 37 Gilles Grandgérard
* Saisir le nom d'utilisateur et le mot de passe
59 60 Klaas TJEBBES
* Cliquer sur *Build*
60 60 Klaas TJEBBES
* Dans "historique des builds" un build apparait. Cliquer sur le lien
61 38 Gilles Grandgérard
* Cliquer ensuite sur le lien 'Console Output'
62 37 Gilles Grandgérard
* Le texte affiche la sortie standard du processus de création des réseaux virtuels
63 37 Gilles Grandgérard
 
64 36 Gilles Grandgérard
65 43 Gilles Grandgérard
h2. A.7) Lancer la gateway
66 36 Gilles Grandgérard
67 36 Gilles Grandgérard
* Aller dans OpenNebula (https://benjamin.eole.lan/)
68 35 Gérald Schwartzmann
* Aller dans 'Virtual Resources', puis 'Templates'
69 35 Gérald Schwartzmann
* Chercher 'gateway'
70 35 Gérald Schwartzmann
* Cliquer sur 'Instantiate'.La VM démarre.
71 28 Gilles Grandgérard
72 35 Gérald Schwartzmann
* Vérification
73 35 Gérald Schwartzmann
** Se connecter en VNC avec 'eole/$eole&123456'
74 35 Gérald Schwartzmann
** Taper 'ip addr' ==> vérifier l'IP SW EOLE
75 32 Gérald Schwartzmann
* lancer :
76 32 Gérald Schwartzmann
<pre>
77 32 Gérald Schwartzmann
 ssh root@<ipgateway>  ==> la connexion doit être sans mot de passe car la clef
78 32 Gérald Schwartzmann
</pre>
79 26 Gilles Grandgérard
80 40 Gilles Grandgérard
h1. B) Préparation du poste de travail
81 26 Gilles Grandgérard
82 40 Gilles Grandgérard
h2. B.1) Modifier /etc/hosts
83 26 Gilles Grandgérard
84 35 Gérald Schwartzmann
* Ajouter votre gateway : 
85 26 Gilles Grandgérard
<pre>
86 55 Fabrice Barconnière
192.168.230.<IP> gateway.ac-test.fr gateway
87 1 Gilles Grandgérard
</pre>
88 26 Gilles Grandgérard
89 26 Gilles Grandgérard
* Vérification
90 26 Gilles Grandgérard
<pre>
91 35 Gérald Schwartzmann
ping gateway
92 26 Gilles Grandgérard
ping gateway.ac-test.fr
93 26 Gilles Grandgérard
</pre>
94 26 Gilles Grandgérard
95 40 Gilles Grandgérard
h2. B.2) Ajouter tous les noms des machines ac-test.fr dans /etc/hosts
96 40 Gilles Grandgérard
97 58 Fabrice Barconnière
* Concatener le fichier (eole-ci-tests.git)/scripts/host dans /etc/hosts (connecté root)
98 26 Gilles Grandgérard
99 56 Fabrice Barconnière
<pre>
100 1 Gilles Grandgérard
cd (eole-ci-tests.git)/scripts/
101 1 Gilles Grandgérard
cat hosts >> /etc/hosts
102 33 Gérald Schwartzmann
</pre>
103 1 Gilles Grandgérard
104 40 Gilles Grandgérard
h2. B.3) Activation des routes
105 40 Gilles Grandgérard
106 33 Gérald Schwartzmann
* Executer le fichier (eole-ci-tests.git)/scripts/gateway-up.sh
107 33 Gérald Schwartzmann
Les routes sont inscrites...
108 35 Gérald Schwartzmann
109 46 Gilles Grandgérard
*REMARQUES : ce script devra être lancé à chaque redémarrage de votre machine !*
110 46 Gilles Grandgérard
111 40 Gilles Grandgérard
h2. B.4) Selection de l'identitée SSH ( Si besoin)
112 40 Gilles Grandgérard
113 40 Gilles Grandgérard
Dans le cas, ou vous utilisez plusieurs clef publique ssh, Modifier le fichier '.ssh/config' en ajoutant :
114 39 Benjamin Bohard
<pre>
115 39 Benjamin Bohard
Host *.ac-test.fr
116 40 Gilles Grandgérard
   IdentityFile ~/.ssh/<fichier de la cle copiée dans eole-ci-tests>
117 39 Benjamin Bohard
</pre>
118 39 Benjamin Bohard
119 51 Gilles Grandgérard
h2. B.5) Astuce SSH knows hosts
120 51 Gilles Grandgérard
121 51 Gilles Grandgérard
Pour éviter les message know_hosts, vous pouvez modifier le fichier '.ssh/config' en ajoutant :
122 51 Gilles Grandgérard
<pre>
123 51 Gilles Grandgérard
# Use daily destroyed file to avoid pain with VMs
124 51 Gilles Grandgérard
Host *.ac-test.fr 192.168.230.1?? 192.168.230.2??
125 51 Gilles Grandgérard
  CheckHostIP no
126 51 Gilles Grandgérard
  UserKnownHostsFile /tmp/ac-test.fr
127 51 Gilles Grandgérard
  StrictHostKeyChecking no
128 51 Gilles Grandgérard
</pre>
129 51 Gilles Grandgérard
130 51 Gilles Grandgérard
h2. B.6) Vérification
131 27 Gilles Grandgérard
132 44 Gilles Grandgérard
* Aller dans OpenNebual (https://benjamin.eole.lan/)
133 44 Gilles Grandgérard
* Aller dans 'Virtual Resources', puis 'Templates'
134 44 Gilles Grandgérard
* Chercher 'aca.eolebase'
135 44 Gilles Grandgérard
* Cliquer sur 'Instantiate'.La VM démarre.
136 44 Gilles Grandgérard
* Se connecter en VNC avec 'eole/$eole&123456'
137 44 Gilles Grandgérard
* Taper 'ip addr' ==> vérifier l'IP SW EOLE
138 27 Gilles Grandgérard
139 27 Gilles Grandgérard
140 45 Gilles Grandgérard
h1. C) Utilisation d'un template 
141 1 Gilles Grandgérard
142 59 Gérald Schwartzmann
Choisir la machine dans Nebula et l'instancier
143 59 Gérald Schwartzmann
144 59 Gérald Schwartzmann
<pre>
145 59 Gérald Schwartzmann
# ssh root@nomDeMachine
146 59 Gérald Schwartzmann
</pre>
147 59 Gérald Schwartzmann
148 59 Gérald Schwartzmann
Exemple :
149 59 Gérald Schwartzmann
150 59 Gérald Schwartzmann
<pre>
151 59 Gérald Schwartzmann
# ssh root@amonecole.etb3.ac-test.fr
152 59 Gérald Schwartzmann
</pre>
153 59 Gérald Schwartzmann
154 59 Gérald Schwartzmann
<pre>
155 59 Gérald Schwartzmann
# cd /mnt/eole-ci-tests/scripts
156 59 Gérald Schwartzmann
</pre>
157 59 Gérald Schwartzmann
158 59 Gérald Schwartzmann
Le script getVMContext.sh permet de charger les variables contextuelles du module
159 59 Gérald Schwartzmann
160 59 Gérald Schwartzmann
<pre>
161 59 Gérald Schwartzmann
root@amonecole:/mnt/eole-ci-tests/scripts# ./getVMContext.sh 
162 59 Gérald Schwartzmann
VM_ONE           = 
163 59 Gérald Schwartzmann
VM_ID            = 7295
164 59 Gérald Schwartzmann
VM_OWNER         = gerald
165 59 Gérald Schwartzmann
VM_MACHINE       = etb3.amonecole
166 59 Gérald Schwartzmann
VM_MAJAUTO       = DEV
167 59 Gérald Schwartzmann
VM_VERSIONMAJEUR = 2.4.1
168 59 Gérald Schwartzmann
VM_MODULE        = amonecole
169 59 Gérald Schwartzmann
VM_CONTAINER     = oui
170 59 Gérald Schwartzmann
VM_HOSTNAME      = amonecole
171 59 Gérald Schwartzmann
VM_DNSNAME       = amonecole.etb3.ac-test.fr
172 59 Gérald Schwartzmann
VM_ETABLISSEMENT = etb3
173 59 Gérald Schwartzmann
VM_ETH0_IP       = 192.168.0.33
174 59 Gérald Schwartzmann
VM_ETH0_GW       = 192.168.0.1
175 59 Gérald Schwartzmann
VM_ETH1_IP       = 10.3.2.1
176 59 Gérald Schwartzmann
---
177 59 Gérald Schwartzmann
root@amonecole:/mnt/eole-ci-tests/scripts#
178 59 Gérald Schwartzmann
</pre>
179 59 Gérald Schwartzmann
180 59 Gérald Schwartzmann
Le script configure-vm.sh permet ???
181 59 Gérald Schwartzmann
182 59 Gérald Schwartzmann
Pour obtenir de l'aide :
183 59 Gérald Schwartzmann
184 59 Gérald Schwartzmann
<pre>
185 59 Gérald Schwartzmann
# ./configure-vm.sh -h
186 59 Gérald Schwartzmann
</pre>
187 59 Gérald Schwartzmann
188 59 Gérald Schwartzmann
Pour lancer l'instanciation
189 59 Gérald Schwartzmann
190 59 Gérald Schwartzmann
<pre>
191 59 Gérald Schwartzmann
# ./configure-vm.sh -M instance
192 59 Gérald Schwartzmann
</pre>
193 59 Gérald Schwartzmann
194 52 Fabrice Barconnière
h2. C.1)