Difference between revisions of "OpenStack:Masakari"
(Add info on deploying Masakari + references) |
(→Manage: Add description of instance failover/HA) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 6: | Line 6: | ||
NOTE: You will need at least the Train version of <code>kolla-ansible</code> in order to use the <code>enable_masakari</code> override [3]. | NOTE: You will need at least the Train version of <code>kolla-ansible</code> in order to use the <code>enable_masakari</code> override [3]. | ||
| + | |||
| + | Overrides enabling Masakari: | ||
| + | |||
| + | <nowiki> | ||
| + | enable_masakari: "yes" | ||
| + | masakari_install_type: "source" | ||
| + | </nowiki> | ||
| + | |||
| + | Inventory hosts: | ||
| + | |||
| + | <nowiki> | ||
| + | [masakari-api:children] | ||
| + | control | ||
| + | |||
| + | [masakari-engine:children] | ||
| + | control | ||
| + | |||
| + | [masakari-monitors:children] | ||
| + | compute | ||
| + | </nowiki> | ||
| + | |||
| + | Other overrides making Masakari use internal APIs instead of public ones: | ||
| + | |||
| + | <code>config/masakari/masakari-monitors.conf</code> | ||
| + | <nowiki> | ||
| + | [api] | ||
| + | api_interface = internal | ||
| + | </nowiki> | ||
| + | |||
| + | <code>config/masakari/masakari-api.conf</code> | ||
| + | <nowiki> | ||
| + | [DEFAULT] | ||
| + | nova_catalog_admin_info = compute:nova:internalURL | ||
| + | # or | ||
| + | #nova_catalog_admin_info = compute:nova:internal | ||
| + | </nowiki> | ||
| + | |||
| + | <code>config/masakari/masakari-engine.conf</code> | ||
| + | <nowiki> | ||
| + | [DEFAULT] | ||
| + | nova_catalog_admin_info = compute:nova:internalURL | ||
| + | # or | ||
| + | #nova_catalog_admin_info = compute:nova:internal | ||
| + | </nowiki> | ||
| + | |||
| + | Masakari API uses TCP port 15868 by default. | ||
| + | |||
== Manage == | == Manage == | ||
| − | + | === Instance failover/HA === | |
| + | To enable Masakari failover/HA on instances, simply add the following property to your instance: | ||
| + | |||
| + | <nowiki> | ||
| + | $ openstack server set --property HA_Enabled=True <your-instance-name-or-uuid> | ||
| + | </nowiki> | ||
| + | |||
| + | Here is a demonstration of the feature in action: | ||
| + | |||
| + | <nowiki> | ||
| + | compute0:~$ sudo docker exec nova_libvirt virsh list --all | ||
| + | Id Name State | ||
| + | ---------------------------------------------------- | ||
| + | 1 instance-00000002 running | ||
| + | 2 instance-00000001 running | ||
| + | 15 instance-00000004 running | ||
| + | |||
| + | compute0:~$ ps aux | grep instance-00000004 | ||
| + | 42436 24370 40.8 7.6 1361344 308088 ? Sl 15:44 0:18 /usr/libexec/qemu-kvm -name guest=instance-00000004,debug-threads=on ... | ||
| + | ubuntu 24598 0.0 0.0 12940 936 pts/2 S+ 15:44 0:00 grep --color=auto instance-00000004 | ||
| + | compute0:~$ sudo kill -9 24370 | ||
| + | compute0:~$ sudo docker exec nova_libvirt virsh list --all | ||
| + | Id Name State | ||
| + | ---------------------------------------------------- | ||
| + | 1 instance-00000002 running | ||
| + | 2 instance-00000001 running | ||
| + | - instance-00000004 shut off | ||
| + | |||
| + | compute0:~$ sudo tail -1 /var/lib/docker/volumes/kolla_logs/_data/masakari/masakari-instancemonitor.log | ||
| + | 2020-02-13 15:44:53.836 7 INFO masakarimonitors.ha.masakari [-] Response: openstack.instance_ha.v1.notification.Notification(notification_uuid=38e81ead-65b2-41b2-b9fb-21e2f7a4adaa, | ||
| + | status=new, source_host_uuid=0e67ce87-064d-461b-9d1c-77361a7085bd, created_at=2020-02-13T15:44:53.000000, hostname=compute0, updated_at=None, payload={u'instance_uuid': | ||
| + | u'4468d043-7064-4698-a0d4-3113526c7568', u'vir_domain_event': u'STOPPED_FAILED', u'event': u'LIFECYCLE'}, location=Munch({'project': Munch({'domain_id': None, 'id': | ||
| + | u'7129c2ba4ba34dc08ad1b9511de68cac', 'name': None, 'domain_name': None}), 'zone': None, 'region_name': 'RegionOne', 'cloud': '192.168.17.254'}), | ||
| + | generated_time=2020-02-13T15:44:53.009744, type=VM, id=7) | ||
| + | compute0:~$ sudo docker exec nova_libvirt virsh list --all | ||
| + | Id Name State | ||
| + | ---------------------------------------------------- | ||
| + | 1 instance-00000002 running | ||
| + | 2 instance-00000001 running | ||
| + | 16 instance-00000004 running | ||
| + | |||
| + | compute0:~$ | ||
| + | </nowiki> | ||
| + | Notice that the instance gets started on the same hypervisor but with a different KVM domain ID. | ||
== Resources == | == Resources == | ||
Latest revision as of 12:41, 18 February 2020
Deploy
kolla-ansible overrides for Masakari:
https://bitbucket.org/bostonhpc/vkolla/src/masakari/
To create a full (VM-based) deployment with Masakari enabled follow steps listed in README.adoc.
NOTE: You will need at least the Train version of kolla-ansible in order to use the enable_masakari override [3].
Overrides enabling Masakari:
enable_masakari: "yes" masakari_install_type: "source"
Inventory hosts:
[masakari-api:children] control [masakari-engine:children] control [masakari-monitors:children] compute
Other overrides making Masakari use internal APIs instead of public ones:
config/masakari/masakari-monitors.conf
[api] api_interface = internal
config/masakari/masakari-api.conf
[DEFAULT] nova_catalog_admin_info = compute:nova:internalURL # or #nova_catalog_admin_info = compute:nova:internal
config/masakari/masakari-engine.conf
[DEFAULT] nova_catalog_admin_info = compute:nova:internalURL # or #nova_catalog_admin_info = compute:nova:internal
Masakari API uses TCP port 15868 by default.
Manage
Instance failover/HA
To enable Masakari failover/HA on instances, simply add the following property to your instance:
$ openstack server set --property HA_Enabled=True <your-instance-name-or-uuid>
Here is a demonstration of the feature in action:
compute0:~$ sudo docker exec nova_libvirt virsh list --all
Id Name State
----------------------------------------------------
1 instance-00000002 running
2 instance-00000001 running
15 instance-00000004 running
compute0:~$ ps aux | grep instance-00000004
42436 24370 40.8 7.6 1361344 308088 ? Sl 15:44 0:18 /usr/libexec/qemu-kvm -name guest=instance-00000004,debug-threads=on ...
ubuntu 24598 0.0 0.0 12940 936 pts/2 S+ 15:44 0:00 grep --color=auto instance-00000004
compute0:~$ sudo kill -9 24370
compute0:~$ sudo docker exec nova_libvirt virsh list --all
Id Name State
----------------------------------------------------
1 instance-00000002 running
2 instance-00000001 running
- instance-00000004 shut off
compute0:~$ sudo tail -1 /var/lib/docker/volumes/kolla_logs/_data/masakari/masakari-instancemonitor.log
2020-02-13 15:44:53.836 7 INFO masakarimonitors.ha.masakari [-] Response: openstack.instance_ha.v1.notification.Notification(notification_uuid=38e81ead-65b2-41b2-b9fb-21e2f7a4adaa,
status=new, source_host_uuid=0e67ce87-064d-461b-9d1c-77361a7085bd, created_at=2020-02-13T15:44:53.000000, hostname=compute0, updated_at=None, payload={u'instance_uuid':
u'4468d043-7064-4698-a0d4-3113526c7568', u'vir_domain_event': u'STOPPED_FAILED', u'event': u'LIFECYCLE'}, location=Munch({'project': Munch({'domain_id': None, 'id':
u'7129c2ba4ba34dc08ad1b9511de68cac', 'name': None, 'domain_name': None}), 'zone': None, 'region_name': 'RegionOne', 'cloud': '192.168.17.254'}),
generated_time=2020-02-13T15:44:53.009744, type=VM, id=7)
compute0:~$ sudo docker exec nova_libvirt virsh list --all
Id Name State
----------------------------------------------------
1 instance-00000002 running
2 instance-00000001 running
16 instance-00000004 running
compute0:~$
Notice that the instance gets started on the same hypervisor but with a different KVM domain ID.