Many thanks Cratoners,

I think all this looks promising while some things need to be worked out. Have 
to chew this a bit and also join to IRC to discuss further (just that I am in 
different timezone).

As seen in the discussion, there might be a problem in making notification that 
can be used to have an alarm for tenant about his VMs effecting by maintenance. 
Anyhow as one should have the capability to disable host monitoring, it would 
mean the monitoring service should then be aware of the planned maintenance. 
Currently monitoring service like Vitrage (actually sitting on top of raw 
monitoring SW and aware of cloud topology) will be able to make notifications 
that can be consumed by tenant as alarm. Meaning it should easily make tenant 
specific alarm about the planned maintenance.

Nova servers API now has host_status (Mitaka: get-valid-server-state BP) that 
can tell tenant the nova-compute is disabled ( “MAINTENANCE”). New alarm would 
then state it is because  planned maintenance. Surely API would be missing 
where tenant could see the same when querying his servers (where the Nova work 
I mentioned aims to have a link). This might be something needing more thinking.

See you in #craton and happy to work with such a great project!

Br,
Tomi

From: Jim Baker [mailto:[email protected]]
Sent: Thursday, November 17, 2016 4:52 AM
To: OpenStack Development Mailing List (not for usage questions) 
<[email protected]>
Subject: Re: [openstack-dev] [Craton] NFV planned host maintenance



On Wed, Nov 16, 2016 at 10:54 AM, Sulochan Acharya 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

On Wed, Nov 16, 2016 at 2:46 PM, Ian Cordasco 
<[email protected]<mailto:[email protected]>> wrote:
-----Original Message-----
From: Juvonen, Tomi (Nokia - FI/Espoo) 
<[email protected]<mailto:[email protected]>>
Reply: OpenStack Development Mailing List (not for usage questions)
<[email protected]<mailto:[email protected]>>
Date: November 11, 2016 at 02:27:19
To: OpenStack Development Mailing List (not for usage questions)
<[email protected]<mailto:[email protected]>>
Subject:  [openstack-dev] [Craton] NFV planned host maintenance

> I have been looking in past two OpenStack summits to have changes needed to
> fulfill OPNFV Doctor use case for planned host maintenance and at the same
> time trying to find other Ops requirements to satisfy different needs. I was
> just about to start a new project (Fenix), but looking Craton, it seems
> a good alternative and was proposed to me in Barcelona meetup. Here is some
> ideas and would like a comment wither Craton could be used here.

Hi Tomi,

Thanks for your interest in craton! I'm replying in-line, but please
come and join us in #craton on Freenode as well!

> OPNFV Doctor / NFV requirements are described here:
> http://artifacts.opnfv.org/doctor/docs/requirements/02-use_cases.html#nvfi-maintenance
> http://artifacts.opnfv.org/doctor/docs/requirements/03-architecture.html#nfvi-maintenance
> http://artifacts.opnfv.org/doctor/docs/requirements/05-implementation.html#nfvi-maintenance
>
> My rough thoughts about what would be initially needed (as short as I can):
>
> - There should be a database of all hosts matching to what is known by Nova.

So I think this might be the first problem that you'll run into with Craton.

Craton is designed to specifically manage the physical devices in a
data centre. At the moment, it only considers the hosts that you'd run
Nova on, not the Virtual Machines that Nova is managing on the Compute
hosts.

Craton's inventory supports the following modeling:

  1.  devices, which may have a parent (so a strict tree); we map this against 
such entities as top-of-rack switches; hosts; and containers
  2.  logical relationships for these devices, including project, region, cell 
(optional); and arbitrary labels (tags)
  3.  key/value variables on most entities, including devices. Variables 
support resolution - an override mechanism where values are looked up against 
some chain (for device, that's the device tree, cell, region, in that order). 
Values are typed JSON in the underlying (and default) SQLAlchemy model we use.
Craton users synchronize the device inventory from other source of truth 
systems, such as an asset database; or perhaps manually. Meanwhile, variables 
can reflect desired state configuration (so like Ansible); as well as captured 
information.


It's plausible that we could add the ability to track virtual
machines, but Craton is meant to primarily work underneath the cloud.
I think this might be changing since Craton is looking forward to
helping manage a multi-cloud environment, so it's possible this won't
be an issue for long.

Craton's device-focused model, although oriented to hardware, is rather 
arbitrary. Recently we have been also looking at what is needed to support a 
multi-tenant, multi-cloud inventory, and it seems quite feasible to manage in 
Craton's inventory a subset of the resources provided by AWS or Azure.

Does this mean VMs and similar resources? Maybe. However, our thinking has 
been, for relatively fast changing and numerous resources, link to the source 
of truth, in this case Nova. In particular, we have a very model for variables 
that could be readily extended to support what we call virtualized variables - 
dictionary mappings that are implemented by looking up on a remote service. See 
https://bugs.launchpad.net/craton/+bug/1606882 - so long as it implements 
collections.abc.Mapping, we can plug into how variables are resolved.


So I think there is 2 parts to this. 1. What Ian mentioned is that Craton 
currently does not keep inventory of VM running inside an openstack deployment. 
Nova (and Horizon for UI) is already doing this for the users. However, we do 
run jobs or workload on the VM .. like live migrating VM's from a host that 
might undergo maintenance, or a host monitoring flagged as bad etc. This is 
done using `plugins` that talk to nova etc. So I think some of what you are 
looking for falls into that perhaps ? This can be based on some notification 
the Craton engine receives from another application (like monitoring for 
example).


> - There should by an API for Cloud Admin to set planned maintenance window
> for a host (maybe aggregate, group of hosts), when in maintenance and unset
> when finished. There might be some optional parameters like target host
> where to move things currently running on effected host. could also be
> used for retirement of a host.

This sounds like it's part of the next phase of Craton development -
the remediation workflows. I think Jim and Sulo are more suited
towards talking to that though.

So we will be able to trigger a work/job (maintenance) based on 1. User defined 
schedule 2. Based on some notification that we receive from another 
application. Both user defined. Like Ian suggested, this is something we plan 
to do in the next phase.

To further describe: Craton will support an API to run such workflows against 
some device inventory; use from either the REST API or the Craton client that 
wraps. A very reasonable integration would be to use this integration in a 
webhook.


> - There should be project(tenant) and host specific notifications that could:

We are talking about an events/notifications system.

+1. We are working on providing notification messages for all actions within 
the application.

> - Trigger alarm in Aodh so Application would be aware of maintenance state
> changes effecting to his servers, so zero downtime of application could
> be guaranteed.

I'm not sure it should be Craton's responsibility to do this, but I
expect the administrator could set alarm criteria based off of
Craton's events stream.

+1 We need to make sure that we dont try to be a monitoring solution. But like 
Ian said we can always look at using the notification system to do downstream 
processing.

Agreed. Note that the notifications we are planning to publish against 
oslo.messaging are those that change database elements directly controlled by 
Craton, and not linked inventory such as VMs in Nova. But this notification can 
work in concert with Nova notifications.



> - Notification could be consumed by workflow engine like Mistral, where
> application server specific actions flows and admin action flows could
> be performed (to move servers away, disable host,...).
> - Host monitoring like Vitrage could consume notification to disable
> alarms for host as of planned maintenance ongoing and not down by fault.

I think its both ways,
some alarm triggered -> Craton -> Disable the monitoring. But also,
craton notification -> Some application consumes it -> does something else.

So the way I think of this is, Admin sets/schedules some work on a host -> 
Craton workflow will disable your monitoring (given monitoring solution allows 
such action) -> Start the maintenance work, once finished -> Start the 
monitoring again.


> - There should be admin and project level API to query maintenance session
> status.

+1 We have API for all actions... and for all Inventory management as well.

> - Workflow status should be queried or read as notification to keep internal
> state and send further notification.
> - Some more discussion also in "BCN-ops-informal-meetup" that goes beyond 
> this:
> https://etherpad.openstack.org/p/BCN-ops-informal-meetup

These are all interesting ideas. Thank you!

> What else, details, problems:
>
> There is a problem in flow engine actions. Depending on how long maintenance
> would take or what type of server is running, application wants flows to 
> behave
> differently. Application specific flows could surely be done, but problem is
> that they should make admin actions. It should be solved how application can
> decide actions flows while only admin can run them. Should admin make
> the flows and let application a power to choose by hint in nova metadata or
> in notification going to flow engine.

So the way Craton flow/workflow/job works is .. each job is a "plugin". Who can 
run this job is decided though RBAC(work in progress). We expect the plugin to 
have enough logic to decide what it wants to do. We can definitely set TTL for 
a running job. Given it was triggered by "admin" who has "admin actions" 
privilege on Nova you would be allowed to do so.


>
> Started a discussion in Austin summit about extending the planned host
> maintenance in Nova, but it was agreed there could just be a link to external
> tool. Now if this tool would exist in OpenStack, I would suggest to link it
> like this, but surely this is to be seen after the external tool
> implementation exists:

We are far from it right now, but I think Craton would be able to do some of 
it. Like I said before scheduled jobs will be a part of the workflow engine so 
this will be possible. We should discuss more on what this exactly looks like 
etc. Example: Admins would like to upgrade a host. In this case we might 
trigger a workflow to live-migrate all the vm's from that host, disable 
monitoring, disable the service, upgrade the host, enable monitoring, and put 
the host back in production (enabled in nova services) for instance.


> - Nova Services API could have a way for admin to set and unset a "base URL"
> pointing to external tool about planned maintenance effecting to a host.
> - Admin should see link to external tool when querying services via services
> API. This might be formed like: {base URL}/{host_name}
> - Project should have a project specific link to external tool when querying
> via Nova servers API. This might be: {base URL}/project/{hostId}.
> hostId is exposed to project as it do not tell exact host, but otherwise as
> a unique identifier for host:
> hashlib.sha224(projectid + host_name).hexdigest()

I am not sure about this but interaction with Nova through the API is assumed 
as a part of a workflow. Most of it might be encapsulated in the running job in 
the sense that the job you are running is actually doing it. Craton might 
provide the scaffolding to make it easy to do so. I am not sure what the 
possibilities are from Nova side, but you might be able to do so simply by 
scheduling a work on a set of host with just craton perhaps? We can discuss 
more on #craton ?

Please do join us on #craton to work out these details! Thanks for a great set 
of questions.

- Jim
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [email protected]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to