You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Bug Reference

CLOUDSTACK-241

Branch

regions

https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=shortlog;h=refs/heads/regions

Introduction

Purpose

The objective of this feature is to add AWS EC2 like Regions implementation into CloudStack.  Regions are dispersed and located in separate geographic areas. Availability Zones(or Zones in CloudStack) are distinct locations within a Region that are engineered to be isolated from failures in other Zones and provide inexpensive, low latency network connectivity to other Zones in the same Region

Regions would provide the following benefits:

  • Higher availability of the services: users can deploy services across AZs and even if one of the AZ goes down the services are still available to the end-user through VMs deployed in other zones.
  • Higher availability of the MS: Since each MS Cluster only manages a single Region, if that MS Cluster goes down, only that particular Region is impacted. Admin should be able to access all the other Regions.
  • Scalability: The scalability limit of CloudStack dramatically improves, as the scalability limit of MS Cluster is limited to a single Region.
  • Object Store: With Regions construct, CloudStack would also allow users to define Object Store (Secondary Storage) across AZs. This helps users easily deploy VMs in different AZs using the same template, offerings.  
  • Geographical Grouping: Regions allow admins to group AZs (that have low latency and are geographically located nearby) into a broader region construct.

References

Requirements Doc: Regions requirements

Document History

Glossary

Feature Specifications

Introduce the notion of Regions, which will be managed independently by a separate management servers.  With Regions, infrastructure will be organized as follows:

Region -> Zone -> Pod -> Cluster

 Accounts

 User Accounts will be available across Regions. User should be able to use the same account in all Regions. Switching between Regions should not require the user to sign-on again

Templates

 CS Templates are currently zone specific. Templates should be available to all zones within a region. User should be able to migrate templates from one Region to another. This requires S3 like object store

Snapshots

Snapshots also should be available to all zones within a Region. CS currently stores snapshots in secondary storage. Snapshots should instead be stored in the object-store

S3 like Object-store/Integration

Current secondary storage is at zone level. S3 like is object-store or integration with other object-stores(like Hadoop) is required to move data across Regions. Each Region should have object store and the data within it should be available to all zones within the region. Utility to move data across Regions should be supported. Templates and Snapshots will be stored in this object store. Requirements for  S3 based secondary storage.  This is tracked in ticket CLOUDSTACK-714 separately

ELB

ELB will be elevated to Region level. Jira ticket CLOUDSTACK-653

EIP

EIP enhancements CLOUDSTACK-652

Authentication Service

 An authentication service will available for components like object-store to authenticate and get account information using getUser API

Assumptions

Object Store: This feature assumes that S3 like object store is available. Either implemented in CloudStack or through integrations

Templates, Snapshots, EIP and ELP work is not part of this spec. There are being tracked separately as per JIRA tickets mentioned above.

Usage

Usage records will be generated by each Region separately. Portal layer above CS should combine usage across Regions into a consolidated invoice.

Use cases

  1. Create Account

    Create Account A1 in Region1 (Region Id 1). Propagate account creation to all the remaining Regions. An entry will be added to region_sync table if account creation API fails in any region.  Source Region Id for A1 will be 1. External Id(UUID) for the Account should be same in all Regions. Account DB Ids could be different for each Region. 
  2. Update Account (update/disable/enable Account)

    Account update actions are forwarded to the source Region. After source Region is successfully updated, account update is propagated to the remaining Regions. Account update fails if the source Region cannot be updated or is unavailable. 
  3. Delete Account

    Delete Account is forwarded to the source Region. After account is successfully  deleted in the source Region, delete is propagated to the other Regions. Account delete fails if the delete in source Region fails or is unavailable. 
  4. Login to Region A and move to Region B without providing credentialsSimilarly for users and domains.

Architecture and Design description

Database

Each Region will have a separate database. Below data will be common to all databases across Regions:

  1. Account
  2. User
  3. Domain

Remaining data is expected to be per-Region(including projects, global config, resource limits) and not shared across databases in other Regions. 

New Tables

Table

Columns

 

region

id
name
end_point
api_key
secret_key

Integer - Unique Id of the Region. Number regions are expected to be small, hence using integer instead of long
Name of the Region. Should be unique.
Region end_point. e.g http://10.147.30.11:8080/client
api_key of the admin user
secret_key of the admin user

region_sync

id
region_id
api
created
processed

 

Changes to existing tables

Table

New Columns

user

region_id

account

region_id

domain

region_id

Data synchronization

Accounts:

  • When creating the account, it is created first in the Region that the user is logged into
  • Account table will include region_id column, indicating the Region that it is created from
  • This Region is responsible for propagation of Account creation to other Regions
  • Admin user api_key/secret_key are used to make API calls to peer regions. api_key/secret_key are provided while adding the Region.
  • Account deletion/modification is always forwarded to the Region that originally created the account 
  • The Region that originally created account is responsible for deleting the account from all of the regions. If it cannot reach an Region, an entry is created in the region_sync table with api details.

The same applies for Domains and Users.

Create: For any resource created in Region A, MS is Region A  will send API requests to peer Regions along with external Id of the resource. API requests are sent to the peer Regions using the end_point of each Region

Update/Remove: Request is forwarded to the source region. After updating the resource locally, source region sends API requests to peer regions with ispropogate flag set to true.

If any sync API call made by source region fails,an entry will be added to region_sync table with API details. The operation itself won't fail provided the changes were successfully applied locally.

Authentication

Once logged in User should be able to switch from one Region to another without providing credentials again

web services APIs

New APIs

addRegion

Parameters

  1. id: Region Id
  2. name: Name of the Region
  3. endpoint: Region end point. e.g. http://10.147.30.11:8080/client
  4. userapikey: API key of the Admin user
  5. usersecretkey: Secret key of Admin user

updateRegion

Parameters

  1. id: Region Id
  2. name: Name of the Region
  3. endpoint: Region end point. e.g. https://10.147.30.11:8080/client
  4. userapikey: API key of the Admin user
  5. usersecretkey: Secret key of Admin user

removeRegion

Parameters

  1. id: id of the Region to  be removed

listRegions

Parameters

  1. id: list by Region Id
  2. name: list by Region Name

getUser

Parameters 

  1. userapikey: Get user details by API key 

Changes to existing APIs

  • createAccount 
    1. New parameters
      1. accountid : UUID of the account
      2. userid: UUID for the User
      3. regionid: Id of the source Region where Account creation request was initiated
  • deleteAccount, updateAccount, disableAccount, enableAccount
    1. New parameter
      1. ispropagate: Boolean flag which indicated if the API call is being propagated from another Region
  • createUser
    1. userid: UUID for the User. 
    2. regionid: Id of the source Region where User creation request was initiated
  • deleteUser/updateUser/disableUser/enableUser/lockUser
    1. ispropagate: Boolean flag which indicated if the API call is being propagated from another Region
  • createDomain
    • New parameters
      • domainid: UUID for the Domain
      • regionid: Id of the source Region where Domain creation request was initiated
  • deleteDomain/updateDomain
    • ispropagate: Boolean flag which indicated if the API call is being propagated from another Region

Limitations

1. Since all update/delete operations are forwarded to the source region (i.e the region where the resource was initially created), if the source region is down, these operations will fail

2. Any failure to sync API calls will be logged in region_sync table. It will be the responsibility of the cloud operator to propagate these changes offline.

Upgrade

During upgrade, flexibility will be provided to move existing zones into any Region.

Upgrade scenarios:

  • Each zone becomes part of a separate Region: Copy existing DB to all Regions and disable all zones except one in each Region.
  • All zones remain in the same Region: Nothing to do here. 
  • Zones are divided among Regions:  Copy existing DB to all regions and disabling the zones in all Regions other than the selected Region
  • First Region Id will become the source Region Id for all Account/User/Domain resources 

Scripts

Offline scripts will be provided to move data across regions to ease

  • upgrade 
  • add new region
  • remove region

UI flow

  • User/Admin should be able to view all Regions by logging into a MS of any of the Regions. User then should be able to select a specific Region to view details of that Region.
  • Users should be able to switch between various regions for UI using Single Sign-On.

Sample Workflow

Single Region

If an environment has only 1 region, functionality will be same as the current CS installation.  Id of this region will be 1. All accounts/users/domains will have region_is as 1

Adding 2nd Region

1. Install a 2nd CS instance.

2. Before staring the mgmt server for the 1st time, set region id in db.properties(for all mgmt servers in region 2) by adding below line

       region.id=2

3. Start mgmt server

4. Using addRegion API, add region 1 to region 2 and also region 2 to region 1.

5. copy account/user/domain tables from Region1 DB to Region2 DB

Adding 3rd and subsequent Regions

1. Install CS in all new regions

2. Before staring the mgmt server for the 1st time, set region id in db.properties(for all mgmt servers in region N) by adding below line

       region.id=<n> 

3. Start mgmt server

4. Using addRegion API, add existing regions to region n and also region n to all existing regions

5. copy account/user/domain tables from any existing Region DB to RegionN DB

Remove Region

1. Ownership of all the resource created in the region being removed(say Region 3) should change to another region. Set region_id =1 (or one of the other regions) for account/user/doman tables where region_id = 3

2. Remove region from all other regions using removeRegion API

Appendix

Appendix A:

Appendix B:

  • No labels