Skip to content

Commit 9fbfd47

Browse files
committed
Merge pull request #190 from sharady/vmss-v2
VM Schedule Snapshot Design changes v2
2 parents 6dd752b + 7ee74be commit 9fbfd47

File tree

1 file changed

+47
-32
lines changed

1 file changed

+47
-32
lines changed

xapi/design/schedule-snapshot.md

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ title: Schedule Snapshot Design
33
layout: default
44
design_doc: true
55
design_review: 186
6-
revision: 1
6+
revision: 2
77
status: proposed
8+
revision_history:
9+
- revision_number: 1
10+
description: Initial version
11+
- revision_number: 2
12+
description: Renaming VMSS fields and APIs. API message_create superseeds vmss_create_alerts.
813
---
914

1015
The scheduled snapshot feature will utilize the existing architecture of VMPR. In terms of functionality, schedule snapshot is basically VMPR without its archiving capability.
@@ -13,7 +18,14 @@ Introduction
1318
------------
1419

1520
* Schedule snapshot will be a new object in xapi as VMSS.
16-
* A pool can have multiple VMSS and each VMSS will be configured to take snapshot of type disk, checkpoint or quiesce for the VMs as part of VMSS, on configured intervals.
21+
* A pool can have multiple VMSS.
22+
* Multiple VMs can be a part of VMSS but a VM cannot be a part of multiple VMSS.
23+
* A VMSS takes VMs snapshot with type [`snapshot`, `checkpoint`, `snapshot_with_quiesce`].
24+
* VMSS takes snapshot of VMs on configured intervals:
25+
* `hourly` -> On everyday, Each hour, Mins [0;15;30;45]
26+
* `daily` -> On everyday, Hour [0 to 23], Mins [0;15;30;45]
27+
* `weekly` -> Days [`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`], Hour[0 to 23], Mins [0;15;30;45]
28+
* VMSS will have a limit on retaining number of VM snapshots in range [1 to 10].
1729

1830
Datapath Design
1931
---------------
@@ -22,7 +34,6 @@ Datapath Design
2234
* VMSS plugin will go through all the schedule snapshot policies in the pool and check if any of them are due.
2335
* If a snapshot is due then : Go through all the VM objects in XAPI associated with this schedule snapshot policy and create a new snapshot.
2436
* If the snapshot operation fails, create a notification alert for the event and move to the next VM.
25-
* Flag the snapshot to have been created by the schedule service, using either other-config for the VM object or another parameter added for this purpose.
2637
* Check if an older snapshot now needs to be deleted to comply with the retention value defined in the schedule policy.
2738
* If we need to delete any existing snapshots, delete the oldest snapshot created via schedule policy.
2839
* Set the last-run timestamp in the schedule policy.
@@ -34,45 +45,49 @@ There is a new record for VM Scheduled Snapshot with new fields.
3445

3546
New fields:
3647

37-
* "name-label" type String : Name label for VMSS.
38-
* "name-description" type String : Name description for VMSS.
39-
* "is-schedule-snapshot-enabled" type Bool : Enable/Disable VMSS to take snapshot.
40-
* "schedule-snapshot-type" type [DiskSnapshot; Checkpoint; Quiesce] : Type of snapshot policy takes.
41-
* "schedule-snapshot-retention-value" type Int64 : Number of snapshots limit for a VM, max limit is 10.
42-
* "schedule-snapshot-frequency" type [hourly; daily; weekly] : Frequency of taking snapshot of VMs.
43-
* "snapshot-schedule" type (hour: DateTime, min: DateTime, days: string list) : Time Hour, Min of interval of 15mins and Days of a week.
44-
* "is-schedule-snapshot-running" type Bool : If VMSS is in progress of taking snapshot.
45-
* "schedule-snapshot-last-run-time" type Date : DateTime of last execution of VMSS.
46-
* "is-alarm-enabled" type Bool : Alarm enable/disable for VMSS.
47-
* "alarm-config" : type (is_alarm_enabled,["email_address", ((String), "");"smtp_server", ((String), "");"smtp_port", ((IntRange(1,65535)), "25")] : Sets the alarm config field for VMSS.
48-
* "VMs" type VM refs : List of VMs part of VMSS.
48+
* `name-label` type `String` : Name label for VMSS.
49+
* `name-description` type `String` : Name description for VMSS.
50+
* `enabled` type `Bool` : Enable/Disable VMSS to take snapshot.
51+
* `type` type `Enum` [`snapshot`; `checkpoint`; `snapshot_with_quiesce`] : Type of snapshot VMSS takes.
52+
* `retention-value` type `Int64` : Number of snapshots limit for a VM, max limit is 10 and default is 7.
53+
* `frequency` type `Enum` [`hourly`; `daily`; `weekly`] : Frequency of taking snapshot of VMs.
54+
* `schedule` type `Map(String,String)` with (key, value) pair:
55+
* hour : 0 to 23
56+
* min : [0;15;30;45]
57+
* days : [`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`]
58+
* `last-run-time` type Date : DateTime of last execution of VMSS.
59+
* `is-alarm-enabled` type Bool : Alarm enable/disable for VMSS.
60+
* `alarm-config` : `Map(String,String)` with (key, value) pair:
61+
* email_address : ((String), "")
62+
* smtp_server : ((String), "")
63+
* smtp_port : ((IntRange(1,65535)), "25")
64+
Sets the alarm config field for VMSS.
65+
* `VMs` type VM refs : List of VMs part of VMSS.
4966

5067
New fields to VM record:
5168

52-
* "schedule-snapshot" type VMSS ref : VM part of VMSS.
53-
* "is-snapshot-from-vmss" type Bool : If snapshot created from VMSS.
69+
* `schedule-snapshot` type VMSS ref : VM part of VMSS.
70+
* `is-vmss-snapshot` type Bool : If snapshot created from VMSS.
5471

5572
New APIs
5673
--------
5774

5875
* vmss_snapshot_now (Ref vmss, Pool_Operater) -> String : This call executes the schedule snapshot immediately.
59-
* vmss_create_alert (Ref _vmss, String "name", Int "priority", String "body", String "data", Local_Root) -> unit : This call creates an alert for schedule snapshot.
60-
* vmss_get_alerts (Ref vmss, Int "hours_from_now", Pool_Operater) -> Set String : This call fetches a history of alerts for a given schedule snapshot
61-
* vmss_set_snapshot_retention_value (Ref vmss, Int value, Pool_Operater) -> unit : Set the value of the_schedule_snapshot_retention value max is 10.
62-
* vmss_set_is_schedule_snapshot_running (Ref vmss, Bool value, Local_Root) -> unit : Set the value of the is_schedule_snapshot_running field
63-
* vmss_set_snapshot_frequency (Ref vmss, String "value", Pool_Operater) -> unit : Set the value of the snapshot_frequency field
64-
* vmss_set_snapshot_schedule (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the schedule to take snapshot.
65-
* vmss_set_is_alarm_enabled (Ref vmss, Bool "value", Pool_Operater) -> unit : Set the value of the is_alarm_enabled field
66-
* vmss_set_alarm_config (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the alarm_config
67-
* vmss_add_to_snapshot_schedule (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to VMSS
68-
* vmss_add_to_alarm_config (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to alarm_config field.
69-
* vmss_remove_from_snapshot_schedule (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from VMSS.
70-
* vmss_remove_from_alarm_config (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from alarm_config field.
71-
* vmss_set_schedule_snapshot_last_run_time (Ref vmss, DateTime "value", Local_Root) -> unit : Set the last run time for VMSS.
76+
* vmss_get_alerts (Ref vmss, Int "hours_from_now", Pool_Operater) -> Set String : This call fetches a history of alerts for a given schedule snapshot.
77+
* vmss_set_retention_value (Ref vmss, Int value, Pool_Operater) -> unit : Set the value of vmss retention value, max is 10.
78+
* vmss_set_frequency (Ref vmss, String "value", Pool_Operater) -> unit : Set the value of the vmss frequency field.
79+
* vmss_set_type (Ref vmss, String "value", Pool_Operater) -> unit : Set the snapshot type of the vmss type field.
80+
* vmss_set_schedule (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the vmss schedule to take snapshot.
81+
* vmss_set_is_alarm_enabled (Ref vmss, Bool "value", Pool_Operater) -> unit : Set the value of the is_alarm_enabled field.
82+
* vmss_set_alarm_config (Ref vmss, Map(String,String) "value", Pool_Operater) -> unit : Set the alarm_config.
83+
* vmss_add_to_schedule (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to VMSS schedule.
84+
* vmss_add_to_alarm_config (Ref vmss, String "key", String "value", Pool_Operater) -> unit : Add key value pair to VMSS alarm_config field.
85+
* vmss_remove_from_schedule (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from VMSS schedule.
86+
* vmss_remove_from_alarm_config (Ref vmss, String "key", Pool_Operater) -> unit : Remove key from VMSS alarm_config field.
87+
* vmss_set_last_run_time (Ref vmss, DateTime "value", Local_Root) -> unit : Set the last run time for VMSS.
7288

7389
New CLIs
7490
--------
7591

76-
* vmss-create (required : "name-label";"schedule-snapshot-type";"schedule-snapshot-frequency", optional : "name-description";"is-schedule-snapshot-enabled";"snapshot-schedule:";"snapshot-retention-value";"is-alarm-enabled";"alarm-config:") -> unit : Creates VM schedule snapshot.
92+
* vmss-create (required : "name-label";"type";"frequency", optional : "name-description";"is-enabled";"schedule:";"retention-value";"is-alarm-enabled";"alarm-config:") -> unit : Creates VM schedule snapshot.
7793
* vmss-destroy (required : uuid) -> unit : Destroys a VM schedule snapshot.
78-

0 commit comments

Comments
 (0)