Cluster with libvirt » Historique » Version 5
Mehdi Abaakouk, 05/06/2020 11:13
1 | 1 | Mehdi Abaakouk | {{>toc}} |
---|---|---|---|
2 | 1 | Mehdi Abaakouk | |
3 | 1 | Mehdi Abaakouk | h1. Cluster with libvirt |
4 | 1 | Mehdi Abaakouk | |
5 | 1 | Mehdi Abaakouk | h2. Fontionnement |
6 | 1 | Mehdi Abaakouk | |
7 | 1 | Mehdi Abaakouk | Les VM utilisent le mode ethernet de libvirt. En gros libvirt s'attends à trouver un tap tout près pour y accrocher la VM |
8 | 1 | Mehdi Abaakouk | |
9 | 1 | Mehdi Abaakouk | Just avant le boot de la VM libvirt lance: |
10 | 1 | Mehdi Abaakouk | |
11 | 1 | Mehdi Abaakouk | <pre> /etc/libvirt/hooks/qemu <VM_NAME> prepare begin</pre> |
12 | 1 | Mehdi Abaakouk | |
13 | 1 | Mehdi Abaakouk | Et juste après l'arret de la VM libvirt lance: |
14 | 1 | Mehdi Abaakouk | |
15 | 1 | Mehdi Abaakouk | <pre> /etc/libvirt/hooks/qemu <VM_NAME> release end</pre> |
16 | 1 | Mehdi Abaakouk | |
17 | 1 | Mehdi Abaakouk | |
18 | 1 | Mehdi Abaakouk | Le script /etc/libvirt/hooks/qemu de ttnn se trouve ici: https://chiliproject.tetaneutral.net/projects/git-tetaneutral-net/repository/puppetmaster/revisions/master/entry/environments/production/manifests/files/openstack/libvirt-hooks-qemu |
19 | 2 | Mehdi Abaakouk | |
20 | 2 | Mehdi Abaakouk | |
21 | 2 | Mehdi Abaakouk | Ce script va lire les metadatas TTNN de <VM_NAME> (e.g: virsh metadata <VM_NAME> http://tetaneutral.net/) |
22 | 2 | Mehdi Abaakouk | |
23 | 2 | Mehdi Abaakouk | <pre> |
24 | 2 | Mehdi Abaakouk | $ virsh metadata ns2.tetaneutral.net http://tetaneutral.net/ |
25 | 2 | Mehdi Abaakouk | <config> |
26 | 2 | Mehdi Abaakouk | <tap name="tapb0b4a106-d0">89.234.156.248</tap> |
27 | 2 | Mehdi Abaakouk | <tap name="tapabababab-aa">89.234.156.45</tap> |
28 | 2 | Mehdi Abaakouk | </config> |
29 | 2 | Mehdi Abaakouk | </pre> |
30 | 2 | Mehdi Abaakouk | |
31 | 2 | Mehdi Abaakouk | Ensuite il va créé le tap et configurer les routes dessus avec les infos des metadata. |
32 | 1 | Mehdi Abaakouk | |
33 | 1 | Mehdi Abaakouk | |
34 | 3 | Mehdi Abaakouk | h2. Migration from Openstack |
35 | 3 | Mehdi Abaakouk | |
36 | 3 | Mehdi Abaakouk | * virsh dumpxml $id > myvm.xml |
37 | 4 | Mehdi Abaakouk | |
38 | 4 | Mehdi Abaakouk | * delete VM in openstack |
39 | 4 | Mehdi Abaakouk | on openstack.t server: |
40 | 4 | Mehdi Abaakouk | |
41 | 4 | Mehdi Abaakouk | <pre> |
42 | 4 | Mehdi Abaakouk | $ mysql nova -e "update instances set deleted=1 where display_name = 'ns2.tetaneutral.net';" |
43 | 4 | Mehdi Abaakouk | </pre> |
44 | 4 | Mehdi Abaakouk | |
45 | 3 | Mehdi Abaakouk | * edit myvm.xml |
46 | 3 | Mehdi Abaakouk | * change name to <my_new_name> |
47 | 3 | Mehdi Abaakouk | * remove uuid on top and uuid in sysinfo/system/entry[name=uuid] |
48 | 3 | Mehdi Abaakouk | * change domain/devices/interface/@type == ethernet (instead of bridge) |
49 | 3 | Mehdi Abaakouk | * remove <bridge ***> in domain/devices/interface |
50 | 3 | Mehdi Abaakouk | * On top in metadata add (tap names is located in domain/devices/interface/@type): |
51 | 5 | Mehdi Abaakouk | |
52 | 5 | Mehdi Abaakouk | <pre> |
53 | 3 | Mehdi Abaakouk | <ttnn:config xmlns:ttnn="http://tetaneutral.net/"> |
54 | 3 | Mehdi Abaakouk | <ttnn:tap name="tapb0b4a106-d0">89.234.156.248</ttnn:tap> |
55 | 3 | Mehdi Abaakouk | </ttnn:config> |
56 | 5 | Mehdi Abaakouk | </pre> |
57 | 5 | Mehdi Abaakouk | |
58 | 5 | Mehdi Abaakouk | (IP can be found on djadhere or g1:/root/sileht/debug/nova_list) |
59 | 3 | Mehdi Abaakouk | * On top in metadata remove <nova:instance ...></nova:instance> section |
60 | 3 | Mehdi Abaakouk | |
61 | 3 | Mehdi Abaakouk | * virsh destroy $id |
62 | 3 | Mehdi Abaakouk | * virsh undefine $id |
63 | 3 | Mehdi Abaakouk | * virsh define myvm.xml |
64 | 3 | Mehdi Abaakouk | * virsh start <my_new_name> |