-
Notifications
You must be signed in to change notification settings - Fork 24
maintenance mode 3.3 spec
Maitenance mode operations should allow a cloud administrator to perform maitenance of node controllers with minimal intereference with the cloud workload. The general goal is to steer virtual machines away from the node to be maintained and then to re-integrate the node after maitenance has been performed. Two complementary approaches are supported:
- Passive approach involves setting the node into maintenance mode, which means no new VMs will be scheduled on it, and waiting for the natural churn of instances to free up the node.
- Active approach involves migrating VMs away from the node to be maintained using live migration features of the hypervisor.
- Cloud admin may have the option of migrating only specific VMs
- Cloud admin may have the option of migration to only specific destinations
- Cloud admin may have the option of not only specifying, but reserving destination hosts
Two types operations are exposed through the CLC interface for the purposes of node maitenance:
- Enable / Disable Node pair of operations request a specific node to enter or leave maintenance mode (i.e., enter or leave state in which no new instances will be scheduled on the node).
- Migrate Instances operation requests migration of one or all instances from a source node to one or more destinations.
Conceptual | CLC API | CC API | NC/VB API |
---|---|---|---|
Enable / Disable Node
|
EnableService DisableService
|
EnableService DisableService
|
ModifyNode
|
Migrate Instances
|
MigrateInstances
|
ccMigrateInstances
|
ccMigrateInstances
|
Both types of requests are "synchronous" in that an upstream component waits for the corresponding downstream component to respond to the request before it replies. In case of the disable/enable request, the CLC waits for the CC to reply, which waits for the NC to persist the change of state to disk before replying. While CLC is waiting for the downstream components, it is "gating" requests to the cluster: most requests to the cluster, such as running a new instance or attaching a volume to an instance, are queued up.
Similarly, CLC "gates" requests while the Migrate Instance request is pending. Handler for MigrateInstance() on the CC creates the migration plan (i.e., computes the optimal schedule for migration based on the restrictions from the user, if any) and sends it to the source NC for storage. (The primary purpose of the MigrateInstances() request to the source NC is to save the migration plan on disk.) Once NC has acknowledged the migration plan, CC takes into account the reduced resource usage, as does the CLC, prior to unblocking any pending requests.
Instance migration proper is driven by CC in response to state changes on its NCs:
- When a source NC reports itself as ready for outgoing migration, the CC issues the PREPARE request to the destination.
- When a destination NC reports itself as ready for incoming migration, the CC issues the COMMIT request to the source, which effectively initiates the migration.
to be filled in by Garrett
Each level of the system (cloud level, cluster level, and node level) implements operations related to maitenance.
NOTATION: For Eucalyptus 3.3 minimal viable product, only parameters marked with ♣ must be implemented. |
Both CLC and CC implement the same operations with the same parameters:
Requests migration of either a specific instance or all instances on a specific NC or ESX(i) host. Optionally, the request may restrict the set of hosts that can be considered as potential migration destinations either by specifying a white list or a black list.
Name | Description | Required |
---|---|---|
sourceHost♣ |
Name of the NC/ESX host from which all instances are to be migrated (mutually exclusive with instanceId).
|
Yes (XOR instanceId) |
instanceId |
ID of the instance to migrate (mutually exclusive with sourceHost).
|
Yes (XOR sourceHost) |
destinationHost.n |
Set of hosts that are either allowed or disallowed as targets of migration(s), depending on allowHosts. If the set is empty, then all hosts are potential targets for migration, with CC making the choice based on its standard scheduling algorithm.
|
No |
allowHosts |
If true, the hosts in destinationHost set are the only allowed destinations for migration. (In the trivial case of a single host, there is no scheduling to perform.) If false, that set contains hosts explicitly disallowed as destinations. The parameter has no meaning if the set above is empty.
|
No |
Successful response from CLC indicates that:
- the migration request is valid and the participants are present (instance is still running or host is still functioning)
- a migration plan has been computed and recorded on the source NC or in the VB database
- there were sufficient resources to perform the migration and they have been reserved (resource availability will reflect the additional resources necessary during migration)
Name | Description | Required |
---|---|---|
return♣ |
Request accepted if false and error if true
|
Yes |
Successful response from the CC will also include resource availability that resulted from the migrate request.
Name | Description | Required |
---|---|---|
return♣ |
Request accepted if false and error if true
|
Yes |
resources |
Resource matrix (max and available for each VM type) after resources needed for migration are taken into account.
|
Yes |
Requests to disable or enable a node controller are used for placing it into and out of maitenance mode. When in maitenance mode, the node controller:
- is running, but is only responding to a subset of requests (most importantly, RunInstance requests are not accepted)
- is monitoring virtual machines currently running on it
- is not going to be the target of a migration unless it is specifically listed in the white list of a MigrateInstances
Name | Description | Required |
---|---|---|
ServiceId♣ |
what's this?
|
Y |
Type♣ |
Must be "NODE" when used with NC or VB.
|
Y |
Host♣ |
Name of the NC/ESX host that is to be enabled or disabled.
|
Y |
Partition♣ |
Partition associated with the cluster in which NC/ESX host is located.
|
Y |
Successful response to DisableService indicates that the node controller has been placed into maitenance mode. It will remain there until the administrator issues EnableService request for the host.
Name | Description | Required |
---|---|---|
return♣ |
Request accepted if false and error if true
|
Yes |
Successful response from the CC will also include resource availability that resulted from the request to enable or disable.
Name | Description | Required |
---|---|---|
return♣ |
Request accepted if false and error if true
|
Yes |
resources |
Resource matrix (max and available for each VM type) after enabling or disabling of the node has been accounted for.
|
Yes |
NC/VB impelements two operations related to maitenance mode:
Migration of an instance from one hypervisor host to another is accomplished through a sequence of ncMigrateInstances requests issued to the source and destination NCs with different action parameters. The sequence is as follows:
- Migrate request to the source with action set to prepare and a set of all instances to be migrated as part of the user's request. The intention of this request is, at the very least, to permanently record the migration plan so that it can be implemented even if higher-level components restart or failover and lose state. Additionally, source NC may perform checks or any other activities that necessarily precede preparations on the destination. Once ready to send an instance, the source NC sets its migration state to ready.
- Migrate request to each destination with action set to prepare and a set of instances destined for that NC. Using instance metadata and source node credetials included in the request, the NC performs everything necessary to receive an incoming migration: sets up the necessary directory structure, network devices, block devices, authorizes the anticipated incoming migration. Once cready to receive an instance, the destination NC sets its migration state to ready.
- Migrate request to the source with action set to commit and the instance to migrate. This triggers the actual migration.
Name | Description | Required |
---|---|---|
instance.n♣ |
Set of one or more instances to migrate. This data structure contains all instance metadata, as reported in ncDescribeInstances, augmented with the three parameters specific to migration (source, destination, and state), listed below.
|
Yes |
action♣ |
Specific migration-related action to perform.
|
Yes |
credentials♣ |
String encoding the credentials necessary for the source to initiate a migration to the destination. This can be, for example, the public key of the source host.
|
Yes |
Successful response indicates that the request is valid. Additionally, a response to prepare request to source indicates that the migration plan has been persisted to disk. Success of the actual operation can be determined asynchronously, based on the migration state reported in ncDescribeInstances:
- preparing -> ready
- migrating -> cleaning or none
Name | Description | Required |
---|---|---|
return♣ |
Request accepted if false and error if true
|
Yes |
Requests to disable or enable a node controller are both implemented on the NC/VB as a change of state requested with ncModifyNode operation.
Name | Description | Required |
---|---|---|
stateName♣ |
The name of the state to set the Node Controller into.
|
Y |
Successful response to ncModifyNode indicates that the node controller has changed state and the latest state has been persisted to disk. NC/VB maintains its state across NC/VB service restarts and host reboots.
Name | Description | Required |
---|---|---|
return♣ |
Request accepted if false and error if true
|
Yes |
Migration status is reflected in ncDescribeInstance and ccDescribeInstances responses. Within instance metadata the fields related to migration are:
Name | Type | Description |
---|---|---|
migrationSource♣ | String | Host name of the migration source NC/ESX host. |
migrationDestination♣ | String | Host name of the migration destination NC/ESX host. |
migrationState♣ | String | State of the migration on the NC that is responding or state as reported by the CC. The set of allowed state names is enumerated below. |
The set of migration states reported by the CC to the CLC is smaller than the set of states reported by the NC/VB to the CC.
Name | Component | Description |
---|---|---|
none | NC/VB & CC | No current migration-related activities on the host |
preparing | NC/VB & CC | Source or destination is preparing for migration |
ready | NC/VB | Source or destination is ready (to send or receive) a VM |
migrating | NC/VB & CC | Source or destination is in the process of migration |
cleaning | NC/VB | Source of the migration is cleaning up after the migration |
The following diagram depicts the state machine for migration as it exists local to a single NC which participates in the migration. There are two participants (1) source and (2) destination whose states are indicated as appropriate.
From the perspective of the CC a migration's state is contributed by two NCs and combine to define a single state machine which determines the progress of the migration. The following diagram has this state machine.
- NCs should mutually authenticate each other before performing a migration
- credentials should
- be unique to a migration
- uniquely identify an NC
- provide limited access to an NC
- have a limited lifetime
- be valid only for the duration of a migration
- inter-NCs communications should be encrypted
- terminate/run mode for instance store is out; no loss of in memory state
- admin command for quarantine through CLC
- RHEV & VMware seem to be the low hanging fruit functionally
- KVM, Xen reliability are a major question
- is there a way to pause the vm
- vm maintenance mode
- compromised
- what are the benefits?
- controlling workload schedule
- slow down the system
- live migration with attached volumes
tag:rls-3.3 tag:maintenance-mode
- Contact Info
- email: architecture@eucalyptus.com
- IRC: #eucalyptus-devel (freenode)
- Eucalyptus Links