~ » nova list +--------------------------------------+----------+--------+------------+-------------+-------------------------------------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+--------+------------+-------------+-------------------------------------------------+ | 0e75229b-e68f-410a-93cd-65f7879a6955 | WAW-VM-1 | ACTIVE | - | Running | Ext-Net=145.239.30.245, 2001:41d0:601:2000::2db | +--------------------------------------+----------+--------+------------+-------------+-------------------------------------------------+
ubuntu@waw-vm-1:~$ ip a show ens3 2: ens3: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether fa:16:3e:3d:15:76 brd ff:ff:ff:ff:ff:ff inet 145.239.30.245/32 brd 145.239.30.245 scope global ens3 valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fe3d:1576/64 scope link valid_lft forever preferred_lft forever ubuntu@waw-vm-1:~$ ip route default via 145.239.28.1 dev ens3 145.239.28.1 dev ens3 scope link
~ » neutron net-show Local-Net +--------------------------+--------------------------------------+ | Field | Value | +--------------------------+--------------------------------------+ | admin_state_up | True | | description | | | id | d02876b3-0065-4b72-8aba-2cf8360d8a37 | | mtu | 9000 | | name | Local-Net | | provider:network_type | vrack | | provider:segmentation_id | 1000 | | status | ACTIVE | | subnets | 352d9782-55df-46c0-93fc-ab7cff83951d | +--------------------------+--------------------------------------+ ~ »
~ » neutron subnet-show 352d9782-55df-46c0-93fc-ab7cff83951d +-------------------+----------------------------------------------------+ | Field | Value | +-------------------+----------------------------------------------------+ | allocation_pools | {"start": "192.168.0.214", "end": "192.168.0.254"} | | cidr | 192.168.0.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | | | host_routes | | | id | 352d9782-55df-46c0-93fc-ab7cff83951d | | ip_version | 4 | | network_id | d02876b3-0065-4b72-8aba-2cf8360d8a37 | +-------------------+----------------------------------------------------+
~ » nova interface-attach WAW-VM-1 --net-id d02876b3-0065-4b72-8aba-2cf8360d8a37 ~ » nova list +--------------------------------------+----------+--------+------------+-------------+-------------------------------------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+--------+------------+-------------+-------------------------------------------------+ | 0e75229b-e68f-410a-93cd-65f7879a6955 | WAW-VM-1 | ACTIVE | - | Running | Ext-Net=145.239.30.245, 2001:41d0:601:2000::2db | | | | | | | Local-Net=192.168.0.222 | +--------------------------------------+----------+--------+------------+-------------+-------------------------------------------------+
~ » nova list +--------------------------------------+----------+--------+------------+-------------+---------------------------------------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+----------+--------+------------+-------------+---------------------------------------------------+ | 8c193736-b98f-4c5d-b9b1-0186b507b293 | BHS-VM-1 | ACTIVE | - | Running | Ext-Net=142.44.244.158, 2607:5300:201:2100::3:cc9c| | | | | | | Local-Net=192.168.0.2 | +--------------------------------------+----------+--------+------------+-------------+---------------------------------------------------+ ??? W praktyce: * do VMki z WAW dodajemy nowy interfejs z siecią lokalną (to net_id jest to samo co na poprzednich slajdach) * jest też druga, podobna VMka w BHS - sieć tam zrobiona ma to samo segmentation_id (1000) jak ta sieć w WAW * tak samo mógłby być w tym vracku dodany dedyk i mieć interfejs eth1.1000 normalnie by się "widział" z tymi VMkami --- class: regular # Public Cloud ----- Sieć prywatna w OVH - vRack ----- ubuntu@waw-vm-1:~$ mtr -r -c 1 192.168.0.2 Start: Tue Oct 31 14:08:45 2017 HOST: waw-vm-1 Loss% Snt Last Avg Best Wrst StDev 1.|-- 192.168.0.2 0.0% 1 109.3 109.3 109.3 109.3 0.0 ubuntu@waw-vm-1:~$ mtr -r -c 1 142.44.244.158 Start: Tue Oct 31 14:09:28 2017 HOST: waw-vm-1 Loss% Snt Last Avg Best Wrst StDev 1.|-- 145.239.28.1 0.0% 1 0.1 0.1 0.1 0.1 0.0 2.|-- 192.168.250.254 0.0% 1 0.1 0.1 0.1 0.1 0.0 3.|-- 10.13.14.190 0.0% 1 0.2 0.2 0.2 0.2 0.0 4.|-- 10.13.0.220 0.0% 1 0.3 0.3 0.3 0.3 0.0 5.|-- 10.95.100.0 0.0% 1 0.3 0.3 0.3 0.3 0.0 6.|-- vl1067.var-6-a72.pl.eu 0.0% 1 0.8 0.8 0.8 0.8 0.0 7.|-- be100-1102.fra-1-a9.de.eu 0.0% 1 21.6 21.6 21.6 21.6 0.0 8.|-- rbx-g1-nc5.fr.eu 0.0% 1 30.3 30.3 30.3 30.3 0.0 9.|-- 10.95.64.1 0.0% 1 28.8 28.8 28.8 28.8 0.0 10.|-- vl1304.bhs-g1-a75.qc.ca 0.0% 1 106.9 106.9 106.9 106.9 0.0 11.|-- be5.bhs-z2g2-a75.qc.ca 0.0% 1 106.9 106.9 106.9 106.9 0.0 12.|-- 10.98.243.64 0.0% 1 107.0 107.0 107.0 107.0 0.0 13.|-- 149.56.50.176 0.0% 1 106.7 106.7 106.7 106.7 0.0 14.|-- 158.69.61.3 0.0% 1 106.6 106.6 106.6 106.6 0.0 15.|-- 142.44.244.158 0.0% 1 106.8 106.8 106.8 106.8 0.0 ??? No i teraz komunikacja pomiędzy tymi VMkami jest możliwa :) Podsumowując: * Technologia vRack (wirtualna szafa) pozwala na podłączenie, odizolowanie i rozdzielenie usług OVH w ramach jednej lub kilku prywatnych i zabezpieczonych sieci L2!!! --- class: center, middle, regular # Planowane usługi --- class: regular # Public Cloud ----- Load Balancer - OVH IPLB ----- - usługa OVH IPLB - OpenStack Neutron LBaaS API 2.0 - zarządzanie usługą IPLB zarówno przez API OVH i OpenStack ??? * Po pierwsze (najbliżej wdrożenia chyba) LBaaS * Loadbalancer to usługa rozdzielająca ruch pomiędzy serwery * Trwają prace nad integracją produktu OVH IPLB z OpenStack LBaaS API 2.0; pozwoli na zarządzanie load balancerem z poziomu OpenStack API. --- class: regular # Public Cloud ----- Load Balancer - OVH IPLB ----- ??? * Zarządzanie IPLB w panelu OVH * Aktualnie już dostępne dla klientów (Beta) * Można dodawać również VMki z PCI jako serwery backend * Brak wsparcia dla vRack jeszcze --- class: regular # Public Cloud ----- Load Balancer - Neutron LBaaS 2.0 ----- ~ » neutron lbaas-loadbalancer-list +--------------------------------------+-------------------+----------------+---------------------+ | id | name | vip_address | provisioning_status | +--------------------------------------+-------------------+----------------+---------------------+ | b99d4f35-8afc-4c92-99a5-8015be1029ee | ip-91.134.128.132 | 91.134.128.132 | ACTIVE | +--------------------------------------+-------------------+----------------+---------------------+ ~ » neutron lbaas-listener-list +--------------------------------------+-----------------+---------------------+----------+---------------+----------------+ | id | default_pool_id | name | protocol | protocol_port | admin_state_up | +--------------------------------------+-----------------+---------------------+----------+---------------+----------------+ | 51245091-5ae3-dd35-f865-d96967bd03ef | | tcp/frontend/61061 | TCP | 6666 | True | | c3cf62c1-924e-a79f-70c0-e2008706a5f3 | | http/frontend/60504 | HTTP | 9999 | True | | 55b83304-1efa-631e-8903-58702c1cb8f6 | | http/frontend/60375 | HTTP | 80 | True | | 62b3d7bb-9691-cc5f-5e72-21123169c567 | | http/frontend/60377 | HTTP | 8888 | True | +--------------------------------------+-----------------+---------------------+----------+---------------+----------------+ ??? * Tak ma to wyglądać :) * Zarządzanie przez API OpenStack'a * Oczywiście wszystkie create/update/delete call'e do LBaaS (listener, pool, member) są możliwe. * Nie da się zrobić "create loadbalancer" bo to trzeba w panelu OVH zrobić tylko. * Wszystkie zmiany zrobione jedną z tych metod są widoczne od razu przez drugi z interfejsów --- class: regular # Telemetria ----- Usługa pozwalająca na dostarczenie informacji o zużyciu zasobów oraz aktualnym obciążeniu. Trwają prace nad integracją obecnego systemu metryk z OpenStack. Pozwoli to na pobieranie danych z poziomu OpenStack API. ??? * OVH dostarcza, jak produkt, usługi metryk * każdy może wysyłać i pobierać dane z wykorzystaniem Warp10 * cały backend do obsługi metryk jest i działa * OpenStack posiada własne mechanizmy do zbierania i przechowywania metryk * naszym celem jest połączenie tego co w OpenStacku z tym co już mamy wdrożone i dostępne * pracujemy (w mocno deweloperskim środowisku) nad rozwiązaniem, które będzie: * jak najbardziej zgodne z OpenStackiem * korzystało z naszego systemu do metryk * pozwoli na dodanie kolejnych usług OpenStack opartych o metryki * na tę chwilę: * udało się "połączyć" nasz system metryk z serwisem odpowiedzialnym za obsługę przechowywania metryk w OpenStacku (Gnocchi) * zapisywać i odczytywać wartości metryk przy użyciu narzędzi dostępnych w ramach OpenStacka --- class: center, middle, regular ## Telemetria #### Przykładowe metryki ----- $ nova list +--------------------------------------+------------------+--------+ | ID | Name | Status | +--------------------------------------+------------------+--------+ | 1e6c8de0-6ffe-422b-9729-968606f8a31b | testing_instance | ACTIVE | +--------------------------------------+------------------+--------+ $ gnocchi resource list -c id -c type -c original_resource_id +--------------------------------------+----------------------------+-----------------------------------------------------------------------+ | id | type | original_resource_id | +--------------------------------------+----------------------------+-----------------------------------------------------------------------+ | 1e6c8de0-6ffe-422b-9729-968606f8a31b | instance | 1e6c8de0-6ffe-422b-9729-968606f8a31b | | 74101fe3-6aed-5e45-ae1e-05226c5053d6 | instance_network_interface | instance-00000001-1e6c8de0-6ffe-422b-9729-968606f8a31b-tap58d2b129-ad | | b85b3778-95ea-5b21-8f8b-48ca8477e224 | instance_disk | 1e6c8de0-6ffe-422b-9729-968606f8a31b-vda | +--------------------------------------+----------------------------+-----------------------------------------------------------------------+ $ gnocchi metric list | grep 1e6c8de0-6ffe-422b-9729-968606f8a31b | grep cpu_util +--------------------------------------+---------------------+---------------------------------+---------+--------------------------------------+ | id | archive_policy/name | name | unit | resource_id | +--------------------------------------+---------------------+---------------------------------+---------+--------------------------------------+ | ba9359a1-0a22-4355-995b-085f6ee51089 | ovh | cpu_util | None | 1e6c8de0-6ffe-422b-9729-968606f8a31b | +--------------------------------------+---------------------+---------------------------------+---------+--------------------------------------+ ??? * dla przykładu: dla istniejące instancji, możliwe jest odczytanie wartości obciążenia procentowego procesora --- class: center, middle, regular ## Telemetria #### Przykładowe metryki ----- $ gnocchi measures show ba9359a1-0a22-4355-995b-085f6ee51089 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2017-10-30T20:31:20+00:00 | 1.0 | 0.7906971621 | | 2017-10-30T20:31:04+00:00 | 1.0 | 0.8331819372 | | 2017-10-30T20:30:56+00:00 | 1.0 | 0.8397322547 | | 2017-10-30T20:30:50+00:00 | 1.0 | 0.8333364261 | | 2017-10-30T20:30:34+00:00 | 1.0 | 0.8161961264 | | 2017-10-30T20:30:20+00:00 | 1.0 | 0.800532321 | | 2017-10-30T20:30:04+00:00 | 1.0 | 0.8000285929 | | 2017-10-30T20:29:50+00:00 | 1.0 | 0.8173879552 | | 2017-10-30T20:29:33+00:00 | 1.0 | 5.96562261 | | 2017-10-30T20:29:20+00:00 | 1.0 | 6.3457825867 | | 2017-10-30T20:29:04+00:00 | 1.0 | 6.7974552858 | | 2017-10-30T20:28:50+00:00 | 1.0 | 16.7978234661 | | 2017-10-30T20:28:34+00:00 | 1.0 | 39.6572404722 | +---------------------------+-------------+---------------+ ??? * dla przykładu: dla istniejące instancji, możliwe jest odczytanie wartości obciążenia procentowego procesora --- class: center, middle, regular ## Telemetria #### Przykładowe metryki ----- ![](images/grafana-metrics.png) ----- Grafana dostępna jest z poziomu Manager ??? * te same wartości widoczne są w ramach Grafany, która jest dostępna z poziomu Manager --- class: regular # Automatyzacja ----- Usługi OpenStack Aodh oraz Heat bazują na danych z metrykach i pozwalają na automatyzację zarządzania cloudem. Alarmy wyzwalane są przy określonych wartościach metryk. Określone alarmy powodują akcje, którymi mogą być dynamiczne dodawanie lub usuwanie instancji. ??? * same metryki niczego nie zmieniają * w oparciu o wartości metryk możliwe jest podejmowanie pewnych działań * w świecie OpenStack są odpowiedzialne za to serwisu, które automatyzują proces orchestracji zasobów * Aodh odpowiada za definicje i ewaluację alarmów * Heat odpowiada za zarządzenia alarmami oraz zasobami * innymi słowy: * tworzymi stos w ramach Heat'a * Heat tworzy (w oparciu o podane definicje) alarmy, które, jeśli zachodzą warunki, powodują pewne akcje, które wykonuje Heat * alarmy ewaluaowane są przez Aodh co jakiś czas * ewaluacja alarmów polega na odpotywaniu serwisu metryk zapytaniem agregującym wyniki np. w ramach danego stosu (server_group) --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ openstack stack list +--------------------------------------+---------------+----------------------------------+-----------------+----------------------+--------------+ | ID | Stack Name | Project | Stack Status | Creation Time | Updated Time | +--------------------------------------+---------------+----------------------------------+-----------------+----------------------+--------------+ | 9299ada4-20e7-4682-b8ba-3f9517646472 | testing_stack | 853de3a604084184bfa18948220f309b | CREATE_COMPLETE | 2017-10-31T08:51:24Z | None | +--------------------------------------+---------------+----------------------------------+-----------------+----------------------+--------------+ $ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------: | 42de4c5b-be90-4971-9c06-cd7188bba928 | te-g_stack-asg-oh2uc3a6pztc-rcnrmap2iroe-nimt3jfhue7g | ACTIVE | - | Running | private=fdab:: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------: $ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+---------: | alarm_id | type | name | state | severity: +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+---------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | alarm | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+---------: ??? * dla przykładu: stworzyliśmy stos, który posiada minimalnie jedną instancję * na potrzeby skalowania (w górę i w dół) stworzone zostały alarmy, które posiadają warunki: mniej niż 20% dla low, więcej niż 80% dla high * obecnie stan alarm jest dla sytuacji low, a że minimalnie ma być jedna instancja, to ta jedyna istancja nie jest usunięta --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:11:15+00:00 | 15.0 | 0.8114249292 | | 2017-10-31T09:11:30+00:00 | 15.0 | 0.9610490475 | | 2017-10-31T09:11:45+00:00 | 15.0 | 1.3871397001 | | 2017-10-31T09:12:00+00:00 | 15.0 | 19.1047855617 | +---------------------------+-------------+---------------+ $ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | alarm | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: ??? * na tej jednej, jedynej instacji zacząłem generować obciążenie --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:11:30+00:00 | 15.0 | 0.9610490475 | | 2017-10-31T09:11:45+00:00 | 15.0 | 1.3871397001 | | 2017-10-31T09:12:00+00:00 | 15.0 | 19.1047855617 | | 2017-10-31T09:12:15+00:00 | 15.0 | 63.525273101 | +---------------------------+-------------+---------------+ $ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | ok | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: ??? * po chwili okazało się, że wynik zapytania agregującego (takiego, jakie wykonuje Aodh, przy ewaluacji alarmów), daje wartość, która ustawia stan obu alarmów na okey (wpadło w zakres 20~80%) --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:12:00+00:00 | 15.0 | 19.1047855617 | | 2017-10-31T09:12:15+00:00 | 15.0 | 63.525273101 | | 2017-10-31T09:12:30+00:00 | 15.0 | 100.0 | | 2017-10-31T09:12:45+00:00 | 15.0 | 100.0 | +---------------------------+-------------+---------------+ $ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | ok | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: ??? * chwilę później wartość jest powyżej 80%, ale to nie powoduje od razu zmiany stanu alarmu na alarm * w zależności od konfiguracji stosu oraz tego, jak często Aodh evaluator jest uruchamiany, zmiana stanu następuje po jakimś czasie i/lub ilości pomiarów --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:12:30+00:00 | 15.0 | 100.0 | | 2017-10-31T09:12:45+00:00 | 15.0 | 100.0 | | 2017-10-31T09:13:00+00:00 | 15.0 | 99.8563531989 | | 2017-10-31T09:13:15+00:00 | 15.0 | 100.0 | +---------------------------+-------------+---------------+ $ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | alarm | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | ok | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: ??? * w naszym przypadku, po 30 sekundach, alarm jest ustawiony * w efekcie, wykonywana jest akcja uruchomienia nowej instancji --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | fe6b5388-27dd-4603-be5e-10b2e3f7bb8a | te-g_stack-asg-oh2uc3a6pztc-47aplmox5upl-bs6dzk6io7px | BUILD | spawning | NOSTATE | : | 3473c195-35c5-4481-b617-69760589cdda | te-g_stack-asg-oh2uc3a6pztc-f6nokdv7p43p-llk5gfli7fqe | ACTIVE | - | Running | private=fd: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: ??? * instancja się "spawa" --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ---- $ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | fe6b5388-27dd-4603-be5e-10b2e3f7bb8a | te-g_stack-asg-oh2uc3a6pztc-47aplmox5upl-bs6dzk6io7px | ACTIVE | - | Running | private=fd: | 3473c195-35c5-4481-b617-69760589cdda | te-g_stack-asg-oh2uc3a6pztc-f6nokdv7p43p-llk5gfli7fqe | ACTIVE | - | Running | private=fd: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: ??? * proszę zwrócić uwagę na UUID **fe6b..** --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:13:30+00:00 | 15.0 | 100.0 | | 2017-10-31T09:13:45+00:00 | 15.0 | 100.0 | | 2017-10-31T09:14:00+00:00 | 15.0 | 99.7595040144 | | 2017-10-31T09:14:15+00:00 | 15.0 | 84.6924908101 | | 2017-10-31T09:14:30+00:00 | 15.0 | 30.9673945193 | | 2017-10-31T09:14:45+00:00 | 15.0 | 21.8027558178 | | 2017-10-31T09:15:00+00:00 | 15.0 | 6.0431264803 | | 2017-10-31T09:15:15+00:00 | 15.0 | 1.44324279385 | | 2017-10-31T09:15:30+00:00 | 15.0 | 1.9409027766 | +---------------------------+-------------+---------------+ ??? * obciążanie pierwszej instacji zostało wyłączone --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- $ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | fe6b5388-27dd-4603-be5e-10b2e3f7bb8a | te-g_stack-asg-oh2uc3a6pztc-47aplmox5upl-bs6dzk6io7px | ACTIVE | - | Running | private=fd: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: $ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | alarm | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: ??? * następuje alarm w dolnym zakresie * co by zaoszczędzić, niepotrzebna instacja została usunięta * proszę zauważyć, że usunięta została starsza instancja * nowa zostanie usunięta przy najbliższej, podobnej sytuacji - to jest działanie domyślne * przy tego typu automatyzacji zakłada się, że instancja jest bezstanowa (stan jest w bazie), ale może się popsuć - dlatego usuwa się starsze, a zostawia młodsze instancje --- class: center, middle, regular ## Automatyzacja #### Przykład użycia ----- ??? * jak to jest (będzie) widoczne przez Grafanę --- class: center, middle, regular ## Pytania ??? **JAKIE** mają państwo pytania? --- class: center, middle, regular ## Dziękujemy ??? Ukłony, oklaski..
ubuntu@waw-vm-1:~$ mtr -r -c 1 192.168.0.2 Start: Tue Oct 31 14:08:45 2017 HOST: waw-vm-1 Loss% Snt Last Avg Best Wrst StDev 1.|-- 192.168.0.2 0.0% 1 109.3 109.3 109.3 109.3 0.0
ubuntu@waw-vm-1:~$ mtr -r -c 1 142.44.244.158 Start: Tue Oct 31 14:09:28 2017 HOST: waw-vm-1 Loss% Snt Last Avg Best Wrst StDev 1.|-- 145.239.28.1 0.0% 1 0.1 0.1 0.1 0.1 0.0 2.|-- 192.168.250.254 0.0% 1 0.1 0.1 0.1 0.1 0.0 3.|-- 10.13.14.190 0.0% 1 0.2 0.2 0.2 0.2 0.0 4.|-- 10.13.0.220 0.0% 1 0.3 0.3 0.3 0.3 0.0 5.|-- 10.95.100.0 0.0% 1 0.3 0.3 0.3 0.3 0.0 6.|-- vl1067.var-6-a72.pl.eu 0.0% 1 0.8 0.8 0.8 0.8 0.0 7.|-- be100-1102.fra-1-a9.de.eu 0.0% 1 21.6 21.6 21.6 21.6 0.0 8.|-- rbx-g1-nc5.fr.eu 0.0% 1 30.3 30.3 30.3 30.3 0.0 9.|-- 10.95.64.1 0.0% 1 28.8 28.8 28.8 28.8 0.0 10.|-- vl1304.bhs-g1-a75.qc.ca 0.0% 1 106.9 106.9 106.9 106.9 0.0 11.|-- be5.bhs-z2g2-a75.qc.ca 0.0% 1 106.9 106.9 106.9 106.9 0.0 12.|-- 10.98.243.64 0.0% 1 107.0 107.0 107.0 107.0 0.0 13.|-- 149.56.50.176 0.0% 1 106.7 106.7 106.7 106.7 0.0 14.|-- 158.69.61.3 0.0% 1 106.6 106.6 106.6 106.6 0.0 15.|-- 142.44.244.158 0.0% 1 106.8 106.8 106.8 106.8 0.0
~ » neutron lbaas-loadbalancer-list +--------------------------------------+-------------------+----------------+---------------------+ | id | name | vip_address | provisioning_status | +--------------------------------------+-------------------+----------------+---------------------+ | b99d4f35-8afc-4c92-99a5-8015be1029ee | ip-91.134.128.132 | 91.134.128.132 | ACTIVE | +--------------------------------------+-------------------+----------------+---------------------+
~ » neutron lbaas-listener-list +--------------------------------------+-----------------+---------------------+----------+---------------+----------------+ | id | default_pool_id | name | protocol | protocol_port | admin_state_up | +--------------------------------------+-----------------+---------------------+----------+---------------+----------------+ | 51245091-5ae3-dd35-f865-d96967bd03ef | | tcp/frontend/61061 | TCP | 6666 | True | | c3cf62c1-924e-a79f-70c0-e2008706a5f3 | | http/frontend/60504 | HTTP | 9999 | True | | 55b83304-1efa-631e-8903-58702c1cb8f6 | | http/frontend/60375 | HTTP | 80 | True | | 62b3d7bb-9691-cc5f-5e72-21123169c567 | | http/frontend/60377 | HTTP | 8888 | True | +--------------------------------------+-----------------+---------------------+----------+---------------+----------------+
$ nova list +--------------------------------------+------------------+--------+ | ID | Name | Status | +--------------------------------------+------------------+--------+ | 1e6c8de0-6ffe-422b-9729-968606f8a31b | testing_instance | ACTIVE | +--------------------------------------+------------------+--------+
$ gnocchi resource list -c id -c type -c original_resource_id +--------------------------------------+----------------------------+-----------------------------------------------------------------------+ | id | type | original_resource_id | +--------------------------------------+----------------------------+-----------------------------------------------------------------------+ | 1e6c8de0-6ffe-422b-9729-968606f8a31b | instance | 1e6c8de0-6ffe-422b-9729-968606f8a31b | | 74101fe3-6aed-5e45-ae1e-05226c5053d6 | instance_network_interface | instance-00000001-1e6c8de0-6ffe-422b-9729-968606f8a31b-tap58d2b129-ad | | b85b3778-95ea-5b21-8f8b-48ca8477e224 | instance_disk | 1e6c8de0-6ffe-422b-9729-968606f8a31b-vda | +--------------------------------------+----------------------------+-----------------------------------------------------------------------+
$ gnocchi metric list | grep 1e6c8de0-6ffe-422b-9729-968606f8a31b | grep cpu_util +--------------------------------------+---------------------+---------------------------------+---------+--------------------------------------+ | id | archive_policy/name | name | unit | resource_id | +--------------------------------------+---------------------+---------------------------------+---------+--------------------------------------+ | ba9359a1-0a22-4355-995b-085f6ee51089 | ovh | cpu_util | None | 1e6c8de0-6ffe-422b-9729-968606f8a31b | +--------------------------------------+---------------------+---------------------------------+---------+--------------------------------------+
$ gnocchi measures show ba9359a1-0a22-4355-995b-085f6ee51089 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2017-10-30T20:31:20+00:00 | 1.0 | 0.7906971621 | | 2017-10-30T20:31:04+00:00 | 1.0 | 0.8331819372 | | 2017-10-30T20:30:56+00:00 | 1.0 | 0.8397322547 | | 2017-10-30T20:30:50+00:00 | 1.0 | 0.8333364261 | | 2017-10-30T20:30:34+00:00 | 1.0 | 0.8161961264 | | 2017-10-30T20:30:20+00:00 | 1.0 | 0.800532321 | | 2017-10-30T20:30:04+00:00 | 1.0 | 0.8000285929 | | 2017-10-30T20:29:50+00:00 | 1.0 | 0.8173879552 | | 2017-10-30T20:29:33+00:00 | 1.0 | 5.96562261 | | 2017-10-30T20:29:20+00:00 | 1.0 | 6.3457825867 | | 2017-10-30T20:29:04+00:00 | 1.0 | 6.7974552858 | | 2017-10-30T20:28:50+00:00 | 1.0 | 16.7978234661 | | 2017-10-30T20:28:34+00:00 | 1.0 | 39.6572404722 | +---------------------------+-------------+---------------+
$ openstack stack list +--------------------------------------+---------------+----------------------------------+-----------------+----------------------+--------------+ | ID | Stack Name | Project | Stack Status | Creation Time | Updated Time | +--------------------------------------+---------------+----------------------------------+-----------------+----------------------+--------------+ | 9299ada4-20e7-4682-b8ba-3f9517646472 | testing_stack | 853de3a604084184bfa18948220f309b | CREATE_COMPLETE | 2017-10-31T08:51:24Z | None | +--------------------------------------+---------------+----------------------------------+-----------------+----------------------+--------------+
$ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------: | 42de4c5b-be90-4971-9c06-cd7188bba928 | te-g_stack-asg-oh2uc3a6pztc-rcnrmap2iroe-nimt3jfhue7g | ACTIVE | - | Running | private=fdab:: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+--------------:
$ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+---------: | alarm_id | type | name | state | severity: +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+---------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | alarm | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+---------:
$ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:11:15+00:00 | 15.0 | 0.8114249292 | | 2017-10-31T09:11:30+00:00 | 15.0 | 0.9610490475 | | 2017-10-31T09:11:45+00:00 | 15.0 | 1.3871397001 | | 2017-10-31T09:12:00+00:00 | 15.0 | 19.1047855617 | +---------------------------+-------------+---------------+
$ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | alarm | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------:
$ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:11:30+00:00 | 15.0 | 0.9610490475 | | 2017-10-31T09:11:45+00:00 | 15.0 | 1.3871397001 | | 2017-10-31T09:12:00+00:00 | 15.0 | 19.1047855617 | | 2017-10-31T09:12:15+00:00 | 15.0 | 63.525273101 | +---------------------------+-------------+---------------+
$ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | ok | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | ok | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------:
$ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:12:00+00:00 | 15.0 | 19.1047855617 | | 2017-10-31T09:12:15+00:00 | 15.0 | 63.525273101 | | 2017-10-31T09:12:30+00:00 | 15.0 | 100.0 | | 2017-10-31T09:12:45+00:00 | 15.0 | 100.0 | +---------------------------+-------------+---------------+
$ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:12:30+00:00 | 15.0 | 100.0 | | 2017-10-31T09:12:45+00:00 | 15.0 | 100.0 | | 2017-10-31T09:13:00+00:00 | 15.0 | 99.8563531989 | | 2017-10-31T09:13:15+00:00 | 15.0 | 100.0 | +---------------------------+-------------+---------------+
$ aodh alarm list +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | alarm_id | type | name | state | severity : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------: | f16d3bb5-babe-4b13-898e-1c20a1e91684 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_high-tvou3zg7su5l | alarm | low : | 2b2067bc-786e-4a19-964d-d0a2e918f8a0 | gnocchi_aggregation_by_resources_threshold | testing_stack-cpu_alarm_low-lwv3gpmv44x2 | ok | low : +--------------------------------------+--------------------------------------------+-------------------------------------------+-------+----------:
$ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | fe6b5388-27dd-4603-be5e-10b2e3f7bb8a | te-g_stack-asg-oh2uc3a6pztc-47aplmox5upl-bs6dzk6io7px | BUILD | spawning | NOSTATE | : | 3473c195-35c5-4481-b617-69760589cdda | te-g_stack-asg-oh2uc3a6pztc-f6nokdv7p43p-llk5gfli7fqe | ACTIVE | - | Running | private=fd: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------:
$ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | fe6b5388-27dd-4603-be5e-10b2e3f7bb8a | te-g_stack-asg-oh2uc3a6pztc-47aplmox5upl-bs6dzk6io7px | ACTIVE | - | Running | private=fd: | 3473c195-35c5-4481-b617-69760589cdda | te-g_stack-asg-oh2uc3a6pztc-f6nokdv7p43p-llk5gfli7fqe | ACTIVE | - | Running | private=fd: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------:
$ gnocchi measures aggregation \ --resource-type instance \ --query ''server_group="9299ada4-20e7-4682-b8ba-3f9517646472"'' \ --aggregation mean -m cpu_util \ --start "-5 m" --stop now \ --needed-overlap 0 --granularity 15 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ ........................................................... | 2017-10-31T09:13:30+00:00 | 15.0 | 100.0 | | 2017-10-31T09:13:45+00:00 | 15.0 | 100.0 | | 2017-10-31T09:14:00+00:00 | 15.0 | 99.7595040144 | | 2017-10-31T09:14:15+00:00 | 15.0 | 84.6924908101 | | 2017-10-31T09:14:30+00:00 | 15.0 | 30.9673945193 | | 2017-10-31T09:14:45+00:00 | 15.0 | 21.8027558178 | | 2017-10-31T09:15:00+00:00 | 15.0 | 6.0431264803 | | 2017-10-31T09:15:15+00:00 | 15.0 | 1.44324279385 | | 2017-10-31T09:15:30+00:00 | 15.0 | 1.9409027766 | +---------------------------+-------------+---------------+
$ nova list +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | ID | Name | Status | Task State | Power State | Networks : +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: | fe6b5388-27dd-4603-be5e-10b2e3f7bb8a | te-g_stack-asg-oh2uc3a6pztc-47aplmox5upl-bs6dzk6io7px | ACTIVE | - | Running | private=fd: +--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-----------: