Allow tenants to create a virtual cluster that contains multiple instances

Registered by Senhua Huang

This blue print adds an api extension called vcluster to nova. The new api allows the creation/update/delete of virtual clusters. A virtual cluster contains a set of instances, each can be of type "server" and "block-storage", and it contains a set of groups that define the relationship among all the instances. For each group, specification of the relationship (such as anti-affinity/proximity rules) can be defined.

POST v2/{tenant_id}/vclusters/ Create a virtual cluster
GET v2/{tenant_id}/vclusters/{vcluster_id} Describes a specific virtual cluster
DELETE v2/{tenant_id}/vclusters/{vcluster_id} Delete a virtual cluster

Example parameters for virtual clusters in JSON format are given as below.
1. use case of one volume attached to one server
{
"vcluster" : {
        "name" : "new-virtual-cluster",
         "instances" : {
              "instance": {
                     "name": "db-server-1",
                      "type": "server",
                      "spec": {
                              "imageRef": "xxx-yyy-zzz",
                              "flavorRef": "123-456-789"
                       }
               }
              "instance": {
                     "name": "db-vol-1",
                      "type": "volume",
                      "spec": {
                              "size": x,
                              "volume_type": ""
                       }
               }

         }
         "groupings": {
                "grouping": {
                        "name": "group-1",
                        "membersRef": "["db-server-1", "db-vol-1"],
                        "spec" {
                         "rule": "affinity"
                         }
                 }
          }
     }
}
2. use case of a redundant data servers
{
"vcluster" : {
        "name" : "new-virtual-cluster",
         "instances" : {
              "instance": {
                     "name": "db-server-1",
                      "type": "server",
                      "spec": {
                              "imageRef": "xxx-yyy-zzz",
                              "flavorRef": "123-456-789"
                       }
               }
              "instance": {
                     "name": "db-vol-1",
                      "type": "volume",
                      "spec": {
                              "size": x,
                              "volume_type": ""
                       }
               }
                     "name": "db-server-2",
                      "type": "server",
                      "spec": {
                              "imageRef": "xxx-yyy-zzz",
                              "flavorRef": "123-456-789"
                       }
               }
              "instance": {
                     "name": "db-vol-2",
                      "type": "volume",
                      "spec": {
                              "size": x,
                              "volume_type": ""
                       }
               }

         }
         "groupings": {
                "grouping": {
                        "name": "group-1",
                        "membersRef": "["db-server-1", "db-vol-1"],
                        "spec" {
                         "rule": "affinity"
                         }
                 }
                "grouping": {
                        "name": "group-2",
                        "membersRef": "["db-server-2", "db-vol-2"],
                        "spec" {
                         "rule": "affinity"
                         }
                 }
                "grouping": {
                        "name": "group-3",
                        "membersRef": "["db-server-1", "db-server-2"],
                        "spec" {
                         "rule": "anti-affinity"
                         }
                 }
                "grouping": {
                        "name": "group-1",
                        "membersRef": "["db-vol-1", "db-vol-2"],
                        "spec" {
                         "rule": "anti-affinity"
                         }
                 }

          }
     }
}

Blueprint information

Status:
Not started
Approver:
Russell Bryant
Priority:
Undefined
Drafter:
Senhua Huang
Direction:
Needs approval
Assignee:
None
Definition:
Drafting
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

This needs to be discussed on the openstack-dev list. It also seems related to https://blueprints.launchpad.net/nova/+spec/vm-ensembles. --russellb
======
Assuming that both instances and groupings belong to the vcluster definition the semantically correct JSON for use case 2 should look like this:
{
    "vcluster":{
        "name":"new-virtual-cluster",
        "instances":{
            "instance":{
                "name":"db-server-1",
                "type":"server",
                "spec":{
                    "imageRef":"xxx-yyy-zzz",
                    "flavorRef":"123-456-789"
                }
            },
            "instance":{
                "name":"db-vol-1",
                "type":"volume",
                "spec":{
                    "size":"x",
                    "volume_type":""
                }
            },
            "instance":{
                "name":"db-server-2",
                "type":"server",
                "spec":{
                    "imageRef":"xxx-yyy-zzz",
                    "flavorRef":"123-456-789"
                }
            },
            "instance":{
                "name":"db-vol-2",
                "type":"volume",
                "spec":{
                    "size":"x",
                    "volume_type":""
                }
            }
        },
        "groupings":{
            "grouping":{
                "name":"group-1",
                "membersRef":[
                    "db-server-1",
                    "db-vol-1"
                ],
                "spec":{
                    "rule":"affinity"
                }
            },
            "grouping":{
                "name":"group-2",
                "membersRef":[
                    "db-server-2",
                    "db-vol-2"
                ],
                "spec":{
                    "rule":"affinity"
                }
            },
            "grouping":{
                "name":"group-3",
                "membersRef":[
                    "db-server-1",
                    "db-server-2"
                ],
                "spec":{
                    "rule":"anti-affinity"
                }
            },
            "grouping":{
                "name":"group-4",
                "membersRef":[
                    "db-vol-1",
                    "db-vol-2"
                ],
                "spec":{
                    "rule":"anti-affinity"
                }
            }
        }
    }
}

---jarekmisz--- This needs to be discussed on the openstack-dev list. It also seems related to https://blueprints.launchpad.net/nova/+spec/vm-ensembles. --russellb
======
Assuming that both instances and groupings belong to the vcluster definition the semantically correct JSON for use case 2 should look like this:
{
    "vcluster":{
        "name":"new-virtual-cluster",
        "instances":{
            "instance":{
                "name":"db-server-1",
                "type":"server",
                "spec":{
                    "imageRef":"xxx-yyy-zzz",
                    "flavorRef":"123-456-789"
                }
            },
            "instance":{
                "name":"db-vol-1",
                "type":"volume",
                "spec":{
                    "size":"x",
                    "volume_type":""
                }
            },
            "instance":{
                "name":"db-server-2",
                "type":"server",
                "spec":{
                    "imageRef":"xxx-yyy-zzz",
                    "flavorRef":"123-456-789"
                }
            },
            "instance":{
                "name":"db-vol-2",
                "type":"volume",
                "spec":{
                    "size":"x",
                    "volume_type":""
                }
            }
        },
        "groupings":{
            "grouping":{
                "name":"group-1",
                "membersRef":[
                    "db-server-1",
                    "db-vol-1"
                ],
                "spec":{
                    "rule":"affinity"
                }
            },
            "grouping":{
                "name":"group-2",
                "membersRef":[
                    "db-server-2",
                    "db-vol-2"
                ],
                "spec":{
                    "rule":"affinity"
                }
            },
            "grouping":{
                "name":"group-3",
                "membersRef":[
                    "db-server-1",
                    "db-server-2"
                ],
                "spec":{
                    "rule":"anti-affinity"
                }
            },
            "grouping":{
                "name":"group-4",
                "membersRef":[
                    "db-vol-1",
                    "db-vol-2"
                ],
                "spec":{
                    "rule":"anti-affinity"
                }
            }
        }
    }
}

---jarekmisz---

Marking this blueprint as definition: Drafting. If you are still working on this, please re-submit via nova-specs. If not, please mark as obsolete, and add a quick comment to describe why. --johnthetubaguy (20th April 2014)

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.