Openstack Management TTNN » Historique » Version 1
Mehdi Abaakouk, 16/10/2014 12:28
1 | 1 | Mehdi Abaakouk | h1. Openstack Management TTNN |
---|---|---|---|
2 | 1 | Mehdi Abaakouk | |
3 | 1 | Mehdi Abaakouk | h2. Opération sur les VMs |
4 | 1 | Mehdi Abaakouk | |
5 | 1 | Mehdi Abaakouk | h3. Reboot VM en error |
6 | 1 | Mehdi Abaakouk | |
7 | 1 | Mehdi Abaakouk | <pre> |
8 | 1 | Mehdi Abaakouk | nova reset-state --active xxx.tetaneutral.net |
9 | 1 | Mehdi Abaakouk | nova reboot --hard --poll xxx.tetaneutral.net |
10 | 1 | Mehdi Abaakouk | </pre> |
11 | 1 | Mehdi Abaakouk | |
12 | 1 | Mehdi Abaakouk | h3. Agrandissement d'un disque |
13 | 1 | Mehdi Abaakouk | |
14 | 1 | Mehdi Abaakouk | Sur la machine 'openstack': |
15 | 1 | Mehdi Abaakouk | |
16 | 1 | Mehdi Abaakouk | <pre> |
17 | 1 | Mehdi Abaakouk | root@openstack:~/tools ./os-grow-disk.sh |
18 | 1 | Mehdi Abaakouk | usage: os-grow-disk.sh CINDER_VOLUME_ID SIZE_GB |
19 | 1 | Mehdi Abaakouk | |
20 | 1 | Mehdi Abaakouk | root@openstack:~/tools# ./os-grow-disk.sh bc6f01cb-c6b6-4413-b2ef-1f7df0031049 60 |
21 | 1 | Mehdi Abaakouk | Cinder: |
22 | 1 | Mehdi Abaakouk | bc6f01cb-c6b6-4413-b2ef-1f7df0031049 , test4-bootdisk | 40 -> 60 |
23 | 1 | Mehdi Abaakouk | |
24 | 1 | Mehdi Abaakouk | Enter YES to update |
25 | 1 | Mehdi Abaakouk | YES |
26 | 1 | Mehdi Abaakouk | Testing g3 ssh connection... |
27 | 1 | Mehdi Abaakouk | Resizing the kvm blockdevice... |
28 | 1 | Mehdi Abaakouk | Block device 'vda' is resized |
29 | 1 | Mehdi Abaakouk | Updating cinder database with the new value... |
30 | 1 | Mehdi Abaakouk | Update finish |
31 | 1 | Mehdi Abaakouk | </pre> |
32 | 1 | Mehdi Abaakouk | |
33 | 1 | Mehdi Abaakouk | Puis sur la VM: |
34 | 1 | Mehdi Abaakouk | |
35 | 1 | Mehdi Abaakouk | Il faut avoir un 'parted' récent ou patché avec le support du 'online resizepart': |
36 | 1 | Mehdi Abaakouk | |
37 | 1 | Mehdi Abaakouk | 'online resizepart' est natif depuis parted >= 3.1: |
38 | 1 | Mehdi Abaakouk | * debian >= jessie |
39 | 1 | Mehdi Abaakouk | * ubuntu >= 14.10 |
40 | 1 | Mehdi Abaakouk | |
41 | 1 | Mehdi Abaakouk | 'online resizepart' backporté dans: |
42 | 1 | Mehdi Abaakouk | * ubuntu >= 13.10 < 14.10 |
43 | 1 | Mehdi Abaakouk | |
44 | 1 | Mehdi Abaakouk | Pour debian wheezy, utilisation les packages ubuntu de 14.04 devrait marcher |
45 | 1 | Mehdi Abaakouk | (pas encore testé, à voir si le kernel veut bien reload la table des partitions après) |
46 | 1 | Mehdi Abaakouk | |
47 | 1 | Mehdi Abaakouk | <pre> |
48 | 1 | Mehdi Abaakouk | root@test4:~# parted /dev/vda print | grep vda |
49 | 1 | Mehdi Abaakouk | Disk /dev/vda: 64.4GB |
50 | 1 | Mehdi Abaakouk | |
51 | 1 | Mehdi Abaakouk | root@test4# parted /dev/vda resizepart 1 |
52 | 1 | Mehdi Abaakouk | Warning: Partition /dev/vda1 is being used. Are you sure you want to continue? |
53 | 1 | Mehdi Abaakouk | Yes/No? Yes |
54 | 1 | Mehdi Abaakouk | End? [42.9GB]? 64.4GB # METTRE ICI LA TAILLE VU AU DESSUS |
55 | 1 | Mehdi Abaakouk | Information: You may need to update /etc/fstab. |
56 | 1 | Mehdi Abaakouk | |
57 | 1 | Mehdi Abaakouk | root@test4:~# resize2fs /dev/vda1 |
58 | 1 | Mehdi Abaakouk | resize2fs 1.42.9 (4-Feb-2014) |
59 | 1 | Mehdi Abaakouk | Filesystem at /dev/vda1 is mounted on /; on-line resizing required |
60 | 1 | Mehdi Abaakouk | old_desc_blocks = 3, new_desc_blocks = 4 |
61 | 1 | Mehdi Abaakouk | The filesystem on /dev/vda1 is now 15722400 blocks long. |
62 | 1 | Mehdi Abaakouk | |
63 | 1 | Mehdi Abaakouk | root@test4:~# df -h | grep vda |
64 | 1 | Mehdi Abaakouk | /dev/vda1 60G 797M 56G 2% / |
65 | 1 | Mehdi Abaakouk | </pre> |
66 | 1 | Mehdi Abaakouk | |
67 | 1 | Mehdi Abaakouk | h3. Ajout d'une interface réseau à une VM: |
68 | 1 | Mehdi Abaakouk | |
69 | 1 | Mehdi Abaakouk | <pre> |
70 | 1 | Mehdi Abaakouk | $ neutron net-list | grep vlan3199 |
71 | 1 | Mehdi Abaakouk | | 460f49ce-f5ed-449e-9e0f-7626bcee4379 | vlan3199 | ba3f12af-074a-4a31-9a7c-a621993e13bb 192.168.99.0/24 | |
72 | 1 | Mehdi Abaakouk | |
73 | 1 | Mehdi Abaakouk | $ neutron port-create 460f49ce-f5ed-449e-9e0f-7626bcee4379 --name nagios-eth2 --fixed-ips type=dict list=true ip_address=192.168.99.248 |
74 | 1 | Mehdi Abaakouk | Created a new port: |
75 | 1 | Mehdi Abaakouk | +-----------------------+---------------------------------------------------------------------------------------+ |
76 | 1 | Mehdi Abaakouk | | Field | Value | |
77 | 1 | Mehdi Abaakouk | +-----------------------+---------------------------------------------------------------------------------------+ |
78 | 1 | Mehdi Abaakouk | | admin_state_up | True | |
79 | 1 | Mehdi Abaakouk | | allowed_address_pairs | | |
80 | 1 | Mehdi Abaakouk | | binding:host_id | | |
81 | 1 | Mehdi Abaakouk | | binding:profile | {} | |
82 | 1 | Mehdi Abaakouk | | binding:vif_details | {} | |
83 | 1 | Mehdi Abaakouk | | binding:vif_type | unbound | |
84 | 1 | Mehdi Abaakouk | | binding:vnic_type | normal | |
85 | 1 | Mehdi Abaakouk | | device_id | | |
86 | 1 | Mehdi Abaakouk | | device_owner | | |
87 | 1 | Mehdi Abaakouk | | fixed_ips | {"subnet_id": "ba3f12af-074a-4a31-9a7c-a621993e13bb", "ip_address": "192.168.99.248"} | |
88 | 1 | Mehdi Abaakouk | | id | 918e0ec7-0909-423c-9a67-15b5ef7c7ae0 | |
89 | 1 | Mehdi Abaakouk | | mac_address | fa:16:3e:6b:32:07 | |
90 | 1 | Mehdi Abaakouk | | name | nagios-eth2 | |
91 | 1 | Mehdi Abaakouk | | network_id | 460f49ce-f5ed-449e-9e0f-7626bcee4379 | |
92 | 1 | Mehdi Abaakouk | | security_groups | b6d5b5fb-a053-4f97-b964-9e1a12d243b1 | |
93 | 1 | Mehdi Abaakouk | | status | DOWN | |
94 | 1 | Mehdi Abaakouk | | tenant_id | ed980105f9d047e2bee738b3f261f126 | |
95 | 1 | Mehdi Abaakouk | +-----------------------+---------------------------------------------------------------------------------------+ |
96 | 1 | Mehdi Abaakouk | |
97 | 1 | Mehdi Abaakouk | $ nova interface-attach --port-id 918e0ec7-0909-423c-9a67-15b5ef7c7ae0 nagios.tetaneutral.net |
98 | 1 | Mehdi Abaakouk | </pre> |
99 | 1 | Mehdi Abaakouk | |
100 | 1 | Mehdi Abaakouk | Dans la VM: |
101 | 1 | Mehdi Abaakouk | |
102 | 1 | Mehdi Abaakouk | <pre> |
103 | 1 | Mehdi Abaakouk | $ dmesg | tail |
104 | 1 | Mehdi Abaakouk | [ 1315.826088] virtio-pci 0000:00:06.0: using default PCI settings |
105 | 1 | Mehdi Abaakouk | [ 1315.826102] virtio-pci 0000:00:07.0: no hotplug settings from platform |
106 | 1 | Mehdi Abaakouk | [ 1315.826102] virtio-pci 0000:00:07.0: using default PCI settings |
107 | 1 | Mehdi Abaakouk | [ 1315.826116] pci 0000:00:08.0: no hotplug settings from platform |
108 | 1 | Mehdi Abaakouk | [ 1315.826117] pci 0000:00:08.0: using default PCI settings |
109 | 1 | Mehdi Abaakouk | [ 1315.826382] virtio-pci 0000:00:08.0: enabling device (0000 -> 0003) |
110 | 1 | Mehdi Abaakouk | [ 1315.829281] virtio-pci 0000:00:08.0: setting latency timer to 64 |
111 | 1 | Mehdi Abaakouk | [ 1315.829535] virtio-pci 0000:00:08.0: irq 50 for MSI/MSI-X |
112 | 1 | Mehdi Abaakouk | [ 1315.829555] virtio-pci 0000:00:08.0: irq 51 for MSI/MSI-X |
113 | 1 | Mehdi Abaakouk | [ 1315.829563] virtio-pci 0000:00:08.0: irq 52 for MSI/MSI-X |
114 | 1 | Mehdi Abaakouk | |
115 | 1 | Mehdi Abaakouk | $ ip l show dev eth2 |
116 | 1 | Mehdi Abaakouk | 4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000 |
117 | 1 | Mehdi Abaakouk | link/ether fa:16:3e:6b:32:07 brd ff:ff:ff:ff:ff:ff |
118 | 1 | Mehdi Abaakouk | |
119 | 1 | Mehdi Abaakouk | $ tail -4 /etc/network/interfaces |
120 | 1 | Mehdi Abaakouk | auto eth2 |
121 | 1 | Mehdi Abaakouk | iface eth2 inet static |
122 | 1 | Mehdi Abaakouk | address 192.168.99.248 |
123 | 1 | Mehdi Abaakouk | netmask 255.255.255.0 |
124 | 1 | Mehdi Abaakouk | |
125 | 1 | Mehdi Abaakouk | $ ifup eth2 |
126 | 1 | Mehdi Abaakouk | $ ping 192.169.99.250 |
127 | 1 | Mehdi Abaakouk | PING 192.169.99.250 (192.169.99.250) 56(84) bytes of data. |
128 | 1 | Mehdi Abaakouk | 64 bytes from 192.169.99.250: icmp_req=1 ttl=119 time=170 ms |
129 | 1 | Mehdi Abaakouk | 64 bytes from 192.169.99.250: icmp_req=2 ttl=119 time=204 ms |
130 | 1 | Mehdi Abaakouk | ^C |
131 | 1 | Mehdi Abaakouk | </pre> |
132 | 1 | Mehdi Abaakouk | |
133 | 1 | Mehdi Abaakouk | </pre> |
134 | 1 | Mehdi Abaakouk | |
135 | 1 | Mehdi Abaakouk | h2. VM de management (nommé openstack) |
136 | 1 | Mehdi Abaakouk | |
137 | 1 | Mehdi Abaakouk | h3. Live Migration d'un host à l'autre |
138 | 1 | Mehdi Abaakouk | |
139 | 1 | Mehdi Abaakouk | Cela fait tout à notre place niveau kvm/libvirt/ceph |
140 | 1 | Mehdi Abaakouk | |
141 | 1 | Mehdi Abaakouk | <pre> |
142 | 1 | Mehdi Abaakouk | virsh migrate --persistent --undefinesource --live --p2p openstack qemu+ssh://g2:2222/system |
143 | 1 | Mehdi Abaakouk | </pre> |
144 | 1 | Mehdi Abaakouk | |
145 | 1 | Mehdi Abaakouk | h3. Recover depuis une perte de la machine hote: |
146 | 1 | Mehdi Abaakouk | |
147 | 1 | Mehdi Abaakouk | Créé un fichier openstack.xml à partir d'un backup de '/etc/libvirt/qemu/openstack.xml' ou utiliser l'exemple ici: attachment:openstack.xml |
148 | 1 | Mehdi Abaakouk | |
149 | 1 | Mehdi Abaakouk | _Note: il faut surement viré les uuid des interfaces openvswitch qui sont différent suivant le hosts_ |
150 | 1 | Mehdi Abaakouk | |
151 | 1 | Mehdi Abaakouk | Puis on recréé la VM |
152 | 1 | Mehdi Abaakouk | |
153 | 1 | Mehdi Abaakouk | <pre> |
154 | 1 | Mehdi Abaakouk | $ virsh create openstack.xml |
155 | 1 | Mehdi Abaakouk | $ virsh start openstack.xml |
156 | 1 | Mehdi Abaakouk | </pre> |