incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [27/38] git commit: refs/heads/qemu-img - db: Refactor new change in create-schema/premium to schema40-410.sql
Date Mon, 18 Feb 2013 17:21:25 GMT
db: Refactor new change in create-schema/premium to schema40-410.sql

- Move changes since 4.0 to schema upgrade path (schema40-410.sql)
- Comment out some table names where we're trying to copy uuid from id, they
  don't exists
- We don't run above step for tables which are newly created for 410 and don't
  exist in 4.0 for example autoscale related ones, code is commented and not removed
- Drop indexes which are removed before dropping the column
- Comment out insertion, as for default region we're inserting the same in
  code, in ConfigurationServerImpl:createDefaultRegion(), fix same in premium

Testing;
Deployed fresh 4.0 database, compiled and ran mgmt server. It did a smooth
rolling upgrade from 4.0 to 4.1.0 with no database exceptions or any other db error.

TODO:
- 4.2.0 relates changes like ipv6 should go into its schema-410to420.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/c63dbb88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/c63dbb88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/c63dbb88

Branch: refs/heads/qemu-img
Commit: c63dbb88042d7eabea2664c2b608c51792fc9f18
Parents: 8094e93
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Sat Feb 16 17:12:26 2013 +0530
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Sat Feb 16 17:12:26 2013 +0530

----------------------------------------------------------------------
 setup/db/create-schema-premium.sql |    1 -
 setup/db/create-schema.sql         |  277 +-----------------------
 setup/db/db/schema-40to410.sql     |  348 ++++++++++++++++++++++++-------
 3 files changed, 288 insertions(+), 338 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c63dbb88/setup/db/create-schema-premium.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema-premium.sql b/setup/db/create-schema-premium.sql
index e30812b..2f86c0b 100644
--- a/setup/db/create-schema-premium.sql
+++ b/setup/db/create-schema-premium.sql
@@ -137,7 +137,6 @@ CREATE TABLE  `cloud_usage`.`account` (
   `cleanup_needed` tinyint(1) NOT NULL default '0',
   `network_domain` varchar(100) COMMENT 'Network domain name of the Vms of the account',
   `default_zone_id` bigint unsigned,
-  `region_id` int unsigned NOT NULL,
   CONSTRAINT `uc_account__uuid` UNIQUE (`uuid`),
   PRIMARY KEY  (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c63dbb88/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index 369a075..3570dfe 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -207,7 +207,7 @@ CREATE TABLE `cloud`.`version` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
-INSERT INTO `version` (`version`, `updated`, `step`) VALUES('4.1.0', now(), 'Complete');
+INSERT INTO `version` (`version`, `updated`, `step`) VALUES('4.0.0', now(), 'Complete');
 
 CREATE TABLE `cloud`.`op_it_work` (
   `id` char(40) COMMENT 'reservation id',
@@ -352,8 +352,6 @@ CREATE TABLE `cloud`.`network_offerings` (
   `elastic_ip_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides elastic ip service',
   `elastic_lb_service` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides elastic lb service',
   `specify_ip_ranges` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides an ability to define ip ranges',
-  `inline` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Is this network offering LB provider is in inline mode',
-  `is_persistent` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if the network offering provides an ability to create persistent networks',
   PRIMARY KEY (`id`),
   INDEX `i_network_offerings__system_only`(`system_only`),
   INDEX `i_network_offerings__removed`(`removed`),
@@ -528,14 +526,12 @@ CREATE TABLE `cloud`.`snapshots` (
   `removed` datetime COMMENT 'Date removed.  not null if removed',
   `backup_snap_id` varchar(255) COMMENT 'Back up uuid of the snapshot',
   `swift_id` bigint unsigned COMMENT 'which swift',
-  `s3_id` bigint unsigned COMMENT 'S3 to which this snapshot will be stored',
   `sechost_id` bigint unsigned COMMENT 'secondary storage host id',
   `prev_snap_id` bigint unsigned COMMENT 'Id of the most recent snapshot',
   `hypervisor_type` varchar(32) NOT NULL COMMENT 'hypervisor that the snapshot was taken under',
   `version` varchar(32) COMMENT 'snapshot version',
   PRIMARY KEY (`id`),
   CONSTRAINT `uc_snapshots__uuid` UNIQUE (`uuid`),
-  CONSTRAINT `fk_snapshots__s3_id` FOREIGN KEY `fk_snapshots__s3_id` (`s3_id`) REFERENCES `s3` (`id`),
   INDEX `i_snapshots__removed`(`removed`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -711,7 +707,7 @@ CREATE TABLE `cloud`.`op_dc_vnet_alloc` (
     PRIMARY KEY (`id`),
     UNIQUE `i_op_dc_vnet_alloc__vnet__data_center_id__account_id`(`vnet`, `data_center_id`, `account_id`),
     INDEX `i_op_dc_vnet_alloc__dc_taken`(`data_center_id`, `taken`),
-    UNIQUE `i_op_dc_vnet_alloc__vnet__data_center_id`(`vnet`, `physical_network_id`, `data_center_id`),
+    UNIQUE `i_op_dc_vnet_alloc__vnet__data_center_id`(`vnet`, `data_center_id`),
 	CONSTRAINT `fk_op_dc_vnet_alloc__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
 	CONSTRAINT `fk_op_dc_vnet_alloc__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -794,10 +790,12 @@ CREATE TABLE `cloud`.`load_balancer_stickiness_policies` (
 
 CREATE TABLE `cloud`.`inline_load_balancer_nic_map` (
   `id` bigint unsigned NOT NULL auto_increment,
+  `load_balancer_id` bigint unsigned NOT NULL,
   `public_ip_address` char(40) NOT NULL,
   `nic_id` bigint unsigned NULL COMMENT 'nic id',
   PRIMARY KEY  (`id`),
   UNIQUE KEY (`nic_id`),
+  CONSTRAINT `fk_inline_load_balancer_nic_map__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_inline_load_balancer_nic_map__nic_id` FOREIGN KEY(`nic_id`) REFERENCES `nics`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -950,7 +948,6 @@ CREATE TABLE  `cloud`.`user` (
   `timezone` varchar(30) default NULL,
   `registration_token` varchar(255) default NULL,
   `is_registered` tinyint NOT NULL DEFAULT 0 COMMENT '1: yes, 0: no',
-  `region_id` int unsigned NOT NULL,
   `incorrect_login_attempts` integer unsigned NOT NULL DEFAULT 0,
   PRIMARY KEY  (`id`),
   INDEX `i_user__removed`(`removed`),
@@ -1079,7 +1076,6 @@ CREATE TABLE  `cloud`.`vm_instance` (
   `uuid` varchar(40),
   `instance_name` varchar(255) NOT NULL COMMENT 'name of the vm instance running on the hosts',
   `state` varchar(32) NOT NULL,
-  `desired_state` varchar(32) NULL,
   `vm_template_id` bigint unsigned,
   `guest_os_id` bigint unsigned NOT NULL,
   `private_mac_address` varchar(17),
@@ -1169,7 +1165,6 @@ CREATE TABLE  `cloud`.`upload` (
   `id` bigint unsigned NOT NULL auto_increment,
   `host_id` bigint unsigned NOT NULL,
   `type_id` bigint unsigned NOT NULL,
-  `uuid` varchar(40),
   `type` varchar(255),
   `mode` varchar(255),
   `created` DATETIME NOT NULL,
@@ -1302,7 +1297,6 @@ CREATE TABLE  `cloud`.`domain` (
   `state` char(32) NOT NULL default 'Active' COMMENT 'state of the domain',
   `network_domain` varchar(255),
   `type` varchar(255) NOT NULL DEFAULT 'Normal' COMMENT 'type of the domain - can be Normal or Project',
-  `region_id` int unsigned NOT NULL,  
   PRIMARY KEY  (`id`),
   UNIQUE (parent, name, removed),
   INDEX `i_domain__path`(`path`),
@@ -1321,7 +1315,6 @@ CREATE TABLE  `cloud`.`account` (
   `cleanup_needed` tinyint(1) NOT NULL default '0',
   `network_domain` varchar(255),
   `default_zone_id` bigint unsigned,
-  `region_id` int unsigned NOT NULL,  
   PRIMARY KEY  (`id`),
   INDEX i_account__removed(`removed`),
   CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__default_zone_id`(`default_zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
@@ -1384,7 +1377,6 @@ CREATE TABLE `cloud`.`alert` (
   `last_sent` DATETIME NULL COMMENT 'Last time the alert was sent',
   `resolved` DATETIME NULL COMMENT 'when the alert status was resolved (available memory no longer at critical level, etc.)',
   PRIMARY KEY  (`id`),
-  INDEX `last_sent` (`last_sent` DESC),
   CONSTRAINT `uc_alert__uuid` UNIQUE (`uuid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -1395,7 +1387,7 @@ CREATE TABLE `cloud`.`async_job` (
   `session_key` varchar(64) COMMENT 'all async-job manage to apply session based security enforcement',
   `instance_type` varchar(64) COMMENT 'instance_type and instance_id work together to allow attaching an instance object to a job',			
   `instance_id` bigint unsigned,
-  `job_cmd` varchar(255) NOT NULL COMMENT 'command name',
+  `job_cmd` varchar(64) NOT NULL COMMENT 'command name',
   `job_cmd_originator` varchar(64) COMMENT 'command originator',
   `job_cmd_info` text COMMENT 'command parameter info',
   `job_cmd_ver` int(1) COMMENT 'command version',
@@ -1428,15 +1420,16 @@ CREATE TABLE `cloud`.`sync_queue` (
   `id` bigint unsigned NOT NULL auto_increment,
   `sync_objtype` varchar(64) NOT NULL, 
   `sync_objid` bigint unsigned NOT NULL,
+  `queue_proc_msid` bigint,
   `queue_proc_number` bigint COMMENT 'process number, increase 1 for each iteration',
+  `queue_proc_time` datetime COMMENT 'last time to process the queue',
   `created` datetime COMMENT 'date created',
   `last_updated` datetime COMMENT 'date created',
-  `queue_size` smallint DEFAULT 0 COMMENT 'number of items being processed by the queue',
-  `queue_size_limit` smallint DEFAULT 1 COMMENT 'max number of items the queue can process concurrently',
   PRIMARY KEY  (`id`),
   UNIQUE `i_sync_queue__objtype__objid`(`sync_objtype`, `sync_objid`),
   INDEX `i_sync_queue__created`(`created`),
-  INDEX `i_sync_queue__last_updated`(`last_updated`)
+  INDEX `i_sync_queue__last_updated`(`last_updated`),
+  INDEX `i_sync_queue__queue_proc_time`(`queue_proc_time`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`stack_maid` (
@@ -1457,15 +1450,13 @@ CREATE TABLE `cloud`.`sync_queue_item` (
   `content_id` bigint,
   `queue_proc_msid` bigint COMMENT 'owner msid when the queue item is being processed',
   `queue_proc_number` bigint COMMENT 'used to distinguish raw items and items being in process',
-  `queue_proc_time` datetime COMMENT 'when processing started for the item',
   `created` datetime COMMENT 'time created',
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_sync_queue_item__queue_id` FOREIGN KEY `fk_sync_queue_item__queue_id` (`queue_id`) REFERENCES `sync_queue` (`id`) ON DELETE CASCADE,
   INDEX `i_sync_queue_item__queue_id`(`queue_id`),
   INDEX `i_sync_queue_item__created`(`created`),
   INDEX `i_sync_queue_item__queue_proc_number`(`queue_proc_number`),
-  INDEX `i_sync_queue_item__queue_proc_msid`(`queue_proc_msid`),
-  INDEX `i_sync_queue__queue_proc_time`(`queue_proc_time`)
+  INDEX `i_sync_queue_item__queue_proc_msid`(`queue_proc_msid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`disk_offering` (
@@ -1909,37 +1900,6 @@ CREATE TABLE `cloud`.`swift` (
   CONSTRAINT `uc_swift__uuid` UNIQUE (`uuid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
-CREATE TABLE `cloud`.`s3` (
-  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
-  `uuid` varchar(40),
-  `access_key` varchar(20) NOT NULL COMMENT ' The S3 access key',
-  `secret_key` varchar(40) NOT NULL COMMENT ' The S3 secret key',
-  `end_point` varchar(1024) COMMENT ' The S3 host',
-  `bucket` varchar(63) NOT NULL COMMENT ' The S3 host',
-  `https` tinyint unsigned DEFAULT NULL COMMENT ' Flag indicating whether or not to connect over HTTPS',
-  `connection_timeout` integer COMMENT ' The amount of time to wait (in milliseconds) when initially establishing a connection before giving up and timing out.',
-  `max_error_retry` integer  COMMENT ' The maximum number of retry attempts for failed retryable requests (ex: 5xx error responses from services).',
-  `socket_timeout` integer COMMENT ' The amount of time to wait (in milliseconds) for data to be transfered over an established, open connection before the connection times out and is closed.',
-  `created` datetime COMMENT 'date the s3 first signed on',
-  PRIMARY KEY (`id`),
-  CONSTRAINT `uc_s3__uuid` UNIQUE (`uuid`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`template_s3_ref` (
-  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
-  `s3_id` bigint unsigned NOT NULL COMMENT ' Associated S3 instance id',
-  `template_id` bigint unsigned NOT NULL COMMENT ' Associated template id',
-  `created` DATETIME NOT NULL COMMENT ' The creation timestamp',
-  `size` bigint unsigned COMMENT ' The size of the object',
-  `physical_size` bigint unsigned DEFAULT 0 COMMENT ' The physical size of the object',
-  PRIMARY KEY (`id`),
-  CONSTRAINT `uc_template_s3_ref__template_id` UNIQUE (`template_id`),
-  CONSTRAINT `fk_template_s3_ref__s3_id` FOREIGN KEY `fk_template_s3_ref__s3_id` (`s3_id`) REFERENCES `s3` (`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_template_s3_ref__template_id` FOREIGN KEY `fk_template_s3_ref__template_id` (`template_id`) REFERENCES `vm_template` (`id`),
-  INDEX `i_template_s3_ref__s3_id`(`s3_id`),
-  INDEX `i_template_s3_ref__template_id`(`template_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 CREATE TABLE `cloud`.`op_host_transfer` (
   `id` bigint unsigned UNIQUE NOT NULL COMMENT 'Id of the host',
   `initial_mgmt_server_id` bigint unsigned COMMENT 'management server the host is transfered from',
@@ -2130,6 +2090,7 @@ CREATE TABLE `cloud`.`external_load_balancer_devices` (
   `device_state` varchar(32) NOT NULL DEFAULT 'Disabled' COMMENT 'state (enabled/disabled/shutdown) of the device',
   `allocation_state` varchar(32) NOT NULL DEFAULT 'Free' COMMENT 'Allocation state (Free/Shared/Dedicated/Provider) of the device',
   `is_dedicated` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if device/appliance is provisioned for dedicated use only',
+  `is_inline` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if load balancer will be used in in-line configuration with firewall',
   `is_managed` int(1) unsigned NOT NULL DEFAULT 0 COMMENT '1 if load balancer appliance is provisioned and its life cycle is managed by by cloudstack',
   `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external load balancer device',
   `parent_host_id` bigint unsigned COMMENT 'if the load balancer appliance is cloudstack managed, then host id on which this appliance is provisioned',
@@ -2306,16 +2267,6 @@ CREATE TABLE  `cloud`.`netscaler_pod_ref` (
   CONSTRAINT `fk_ns_pod_ref__device_id` FOREIGN KEY (`external_load_balancer_device_id`) REFERENCES `external_load_balancer_devices`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
-
-CREATE TABLE  `cloud`.`region` (
-  `id` int unsigned NOT NULL UNIQUE,
-  `name` varchar(255) NOT NULL UNIQUE,
-  `end_point` varchar(255) NOT NULL,
-  `api_key` varchar(255),
-  `secret_key` varchar(255),
-  PRIMARY KEY  (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 CREATE TABLE `cloud`.`vpc` (
   `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
   `uuid` varchar(40) NOT NULL,
@@ -2477,211 +2428,5 @@ CREATE TABLE `cloud`.`nicira_nvp_nic_map` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
-CREATE TABLE `cloud`.`nicira_nvp_router_map` (
-  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
-  `logicalrouter_uuid` varchar(255) NOT NULL UNIQUE COMMENT 'nicira uuid of logical router',
-  `network_id` bigint unsigned NOT NULL UNIQUE COMMENT 'cloudstack id of the network',
-  PRIMARY KEY (`id`),
-  CONSTRAINT `fk_nicira_nvp_router_map__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`external_bigswitch_vns_devices` (
-  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
-  `uuid` varchar(255) UNIQUE,
-  `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which bigswitch vns device is added',
-  `provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name corresponding to this bigswitch vns device',
-  `device_name` varchar(255) NOT NULL COMMENT 'name of the bigswitch vns device',
-  `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external bigswitch vns device',
-  PRIMARY KEY  (`id`),
-  CONSTRAINT `fk_external_bigswitch_vns_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_external_bigswitch_vns_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`counter` (
-  `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
-  `uuid` varchar(40),
-  `source` varchar(255) NOT NULL COMMENT 'source e.g. netscaler, snmp',
-  `name` varchar(255) NOT NULL COMMENT 'Counter name',
-  `value` varchar(255) NOT NULL COMMENT 'Value in case of source=snmp',
-  `removed` datetime COMMENT 'date removed if not null',
-  `created` datetime NOT NULL COMMENT 'date created',
-  PRIMARY KEY (`id`),
-  CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`),
-  INDEX `i_counter__removed`(`removed`),
-  INDEX `i_counter__source`(`source`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`conditions` (
-  `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
-  `uuid` varchar(40),
-  `counter_id` bigint unsigned NOT NULL COMMENT 'Counter Id',
-  `threshold` bigint unsigned NOT NULL COMMENT 'threshold value for the given counter',
-  `relational_operator` char(2) COMMENT 'relational operator to be used upon the counter and condition',
-  `domain_id` bigint unsigned NOT NULL COMMENT 'domain the Condition belongs to',
-  `account_id` bigint unsigned NOT NULL COMMENT 'owner of this Condition',
-  `removed` datetime COMMENT 'date removed if not null',
-  `created` datetime NOT NULL COMMENT 'date created',
-  PRIMARY KEY (`id`),
-  CONSTRAINT `fk_conditions__counter_id` FOREIGN KEY `fk_condition__counter_id`(`counter_id`) REFERENCES `counter`(`id`),
-  CONSTRAINT `fk_conditions__account_id` FOREIGN KEY `fk_condition__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_conditions__domain_id` FOREIGN KEY `fk_condition__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`),
-  INDEX `i_conditions__removed`(`removed`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`autoscale_vmprofiles` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `uuid` varchar(40),
-  `zone_id` bigint unsigned NOT NULL,
-  `domain_id` bigint unsigned NOT NULL,
-  `account_id` bigint unsigned NOT NULL,
-  `autoscale_user_id` bigint unsigned NOT NULL,
-  `service_offering_id` bigint unsigned NOT NULL,
-  `template_id` bigint unsigned NOT NULL,
-  `other_deploy_params` varchar(1024) COMMENT 'other deployment parameters that is in addition to zoneid,serviceofferingid,domainid',
-  `destroy_vm_grace_period` int unsigned COMMENT 'the time allowed for existing connections to get closed before a vm is destroyed',
-  `counter_params` varchar(1024) COMMENT 'the parameters for the counter to be used to get metric information from VMs',
-  `created` datetime NOT NULL COMMENT 'date created',
-  `removed` datetime COMMENT 'date removed if not null',
-  PRIMARY KEY  (`id`),
-  CONSTRAINT `fk_autoscale_vmprofiles__domain_id` FOREIGN KEY `fk_autoscale_vmprofiles__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmprofiles__account_id` FOREIGN KEY `fk_autoscale_vmprofiles__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmprofiles__autoscale_user_id` FOREIGN KEY `fk_autoscale_vmprofiles__autoscale_user_id` (`autoscale_user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`),
-  INDEX `i_autoscale_vmprofiles__removed`(`removed`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`autoscale_policies` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `uuid` varchar(40),
-  `domain_id` bigint unsigned NOT NULL,
-  `account_id` bigint unsigned NOT NULL,
-  `duration` int unsigned NOT NULL,
-  `quiet_time` int unsigned NOT NULL,
-  `action` varchar(15),
-  `created` datetime NOT NULL COMMENT 'date created',
-  `removed` datetime COMMENT 'date removed if not null',
-  PRIMARY KEY  (`id`),
-  CONSTRAINT `fk_autoscale_policies__domain_id` FOREIGN KEY `fk_autoscale_policies__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_policies__account_id` FOREIGN KEY `fk_autoscale_policies__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`),
-  INDEX `i_autoscale_policies__removed`(`removed`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`autoscale_vmgroups` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `uuid` varchar(40),
-  `zone_id` bigint unsigned NOT NULL,
-  `domain_id` bigint unsigned NOT NULL,
-  `account_id` bigint unsigned NOT NULL,
-  `load_balancer_id` bigint unsigned NOT NULL,
-  `min_members` int unsigned DEFAULT 1,
-  `max_members` int unsigned NOT NULL,
-  `member_port` int unsigned NOT NULL,
-  `interval` int unsigned NOT NULL,
-  `profile_id` bigint unsigned NOT NULL,
-  `state` varchar(255) NOT NULL COMMENT 'enabled or disabled, a vmgroup is disabled to stop autoscaling activity',
-  `created` datetime NOT NULL COMMENT 'date created',
-  `removed` datetime COMMENT 'date removed if not null',
-  PRIMARY KEY  (`id`),
-  CONSTRAINT `fk_autoscale_vmgroup__autoscale_vmprofile_id` FOREIGN KEY(`profile_id`) REFERENCES `autoscale_vmprofiles`(`id`),
-  CONSTRAINT `fk_autoscale_vmgroup__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmgroups__domain_id` FOREIGN KEY `fk_autoscale_vmgroups__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmgroups__account_id` FOREIGN KEY `fk_autoscale_vmgroups__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmgroups__zone_id` FOREIGN KEY `fk_autoscale_vmgroups__zone_id`(`zone_id`) REFERENCES `data_center`(`id`),
-  CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`),
-  INDEX `i_autoscale_vmgroups__removed`(`removed`),
-  INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`)  
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`autoscale_policy_condition_map` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `policy_id` bigint unsigned NOT NULL,
-  `condition_id` bigint unsigned NOT NULL,
-  PRIMARY KEY  (`id`),
-  CONSTRAINT `fk_autoscale_policy_condition_map__policy_id` FOREIGN KEY `fk_autoscale_policy_condition_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id` (`condition_id`) REFERENCES `conditions` (`id`),
-  INDEX `i_autoscale_policy_condition_map__policy_id`(`policy_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `vmgroup_id` bigint unsigned NOT NULL,
-  `policy_id` bigint unsigned NOT NULL,
-  PRIMARY KEY  (`id`),
-  CONSTRAINT `fk_autoscale_vmgroup_policy_map__vmgroup_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__vmgroup_id` (`vmgroup_id`) REFERENCES `autoscale_vmgroups` (`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`),
-  INDEX `i_autoscale_vmgroup_policy_map__vmgroup_id`(`vmgroup_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`region_sync` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `region_id` int unsigned NOT NULL,
-  `api` varchar(1024) NOT NULL,
-  `created` datetime NOT NULL COMMENT 'date created',
-  `processed` tinyint NOT NULL default '0',
-  PRIMARY KEY  (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1, UUID(), 'snmp','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.0', now());
-INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'snmp','Linux System CPU - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
-INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (3, UUID(), 'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
-INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (100, UUID(), 'netscaler','Response Time - microseconds', 'RESPTIME', now());
-CREATE TABLE `cloud`.`vm_snapshots` (
-  `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key',
-  `uuid` varchar(40) NOT NULL,
-  `name` varchar(255) NOT NULL,
-  `display_name` varchar(255) default NULL,
-  `description` varchar(255) default NULL,
-  `vm_id` bigint(20) unsigned NOT NULL,
-  `account_id` bigint(20) unsigned NOT NULL,
-  `domain_id` bigint(20) unsigned NOT NULL,
-  `vm_snapshot_type` varchar(32) default NULL,
-  `state` varchar(32) NOT NULL,
-  `parent` bigint unsigned default NULL,
-  `current` int(1) unsigned default NULL,
-  `update_count` bigint unsigned NOT NULL DEFAULT 0,
-  `updated` datetime default NULL,
-  `created` datetime default NULL,
-  `removed` datetime default NULL,
-  PRIMARY KEY  (`id`),
-  CONSTRAINT UNIQUE KEY `uc_vm_snapshots_uuid` (`uuid`),
-  INDEX `vm_snapshots_name` (`name`),
-  INDEX `vm_snapshots_vm_id` (`vm_id`),
-  INDEX `vm_snapshots_account_id` (`account_id`),
-  INDEX `vm_snapshots_display_name` (`display_name`),
-  INDEX `vm_snapshots_removed` (`removed`),
-  INDEX `vm_snapshots_parent` (`parent`),
-  CONSTRAINT `fk_vm_snapshots_vm_id__vm_instance_id` FOREIGN KEY `fk_vm_snapshots_vm_id__vm_instance_id` (`vm_id`) REFERENCES `vm_instance` (`id`),
-  CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`),
-  CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-
-CREATE TABLE  `cloud`.`user_ipv6_address` (
-  `id` bigint unsigned NOT NULL UNIQUE auto_increment,
-  `uuid` varchar(40),
-  `account_id` bigint unsigned NULL,
-  `domain_id` bigint unsigned NULL,
-  `ip_address` char(50) NOT NULL,
-  `data_center_id` bigint unsigned NOT NULL COMMENT 'zone that it belongs to',
-  `vlan_id` bigint unsigned NOT NULL,
-  `state` char(32) NOT NULL default 'Free' COMMENT 'state of the ip address',
-  `mac_address` varchar(40) NOT NULL COMMENT 'mac address of this ip',
-  `source_network_id` bigint unsigned NOT NULL COMMENT 'network id ip belongs to',
-  `network_id` bigint unsigned COMMENT 'network this public ip address is associated with',
-  `physical_network_id` bigint unsigned NOT NULL COMMENT 'physical network id that this configuration is based on',
-  `created` datetime NULL COMMENT 'Date this ip was allocated to someone',
-  PRIMARY KEY (`id`),
-  UNIQUE (`ip_address`, `source_network_id`),
-  CONSTRAINT `fk_user_ipv6_address__source_network_id` FOREIGN KEY (`source_network_id`) REFERENCES `networks`(`id`),
-  CONSTRAINT `fk_user_ipv6_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
-  CONSTRAINT `fk_user_ipv6_address__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`),
-  CONSTRAINT `fk_user_ipv6_address__vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `vlan`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_user_ipv6_address__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_user_ipv6_address__uuid` UNIQUE (`uuid`),
-  CONSTRAINT `fk_user_ipv6_address__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
 SET foreign_key_checks = 1;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c63dbb88/setup/db/db/schema-40to410.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql
index 9a9441d..9e639c6 100644
--- a/setup/db/db/schema-40to410.sql
+++ b/setup/db/db/schema-40to410.sql
@@ -40,6 +40,7 @@ alter table vm_instance add column owner varchar(255);
 alter table vm_instance add column speed int(10) unsigned;
 alter table vm_instance add column host_name varchar(255);
 alter table vm_instance add column display_name varchar(255);
+alter table vm_instance add column `desired_state` varchar(32) NULL;
 
 alter table data_center add column owner varchar(255);
 alter table data_center add column created datetime COMMENT 'date created';
@@ -171,7 +172,7 @@ CREATE TABLE `cloud`.`template_s3_ref` (
   CONSTRAINT `uc_template_s3_ref__template_id` UNIQUE (`template_id`),
   CONSTRAINT `fk_template_s3_ref__s3_id` FOREIGN KEY `fk_template_s3_ref__s3_id` (`s3_id`) REFERENCES `s3` (`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_template_s3_ref__template_id` FOREIGN KEY `fk_template_s3_ref__template_id` (`template_id`) REFERENCES `vm_template` (`id`),
-  INDEX `i_template_s3_ref__swift_id`(`s3_id`),
+  INDEX `i_template_s3_ref__s3_id`(`s3_id`),
   INDEX `i_template_s3_ref__template_id`(`template_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -189,11 +190,19 @@ ALTER TABLE `cloud`.`external_load_balancer_devices` DROP COLUMN `is_inline`;
 
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network','DEFAULT','NetworkManager','network.dhcp.nondefaultnetwork.setgateway.guestos','Windows','The guest OS\'s name start with this fields would result in DHCP server response gateway information even when the network it\'s on is not default network. Names are separated by comma.');
 
-ALTER TABLE `sync_queue` ADD `queue_size` SMALLINT NOT NULL DEFAULT '0' COMMENT 'number of items being processed by the queue';
+ALTER TABLE `cloud`.`sync_queue` ADD `queue_size` SMALLINT NOT NULL DEFAULT '0' COMMENT 'number of items being processed by the queue';
 
-ALTER TABLE `sync_queue` ADD `queue_size_limit` SMALLINT NOT NULL DEFAULT '1' COMMENT 'max number of items the queue can process concurrently';
+ALTER TABLE `cloud`.`sync_queue` ADD `queue_size_limit` SMALLINT NOT NULL DEFAULT '1' COMMENT 'max number of items the queue can process concurrently';
 
-ALTER TABLE `sync_queue_item` ADD `queue_proc_time` DATETIME NOT NULL COMMENT 'when processing started for the item' AFTER `queue_proc_number`;
+ALTER TABLE `cloud`.`sync_queue` DROP INDEX `i_sync_queue__queue_proc_time`;
+
+ALTER TABLE `cloud`.`sync_queue` DROP COLUMN `queue_proc_time`;
+
+ALTER TABLE `cloud`.`sync_queue` DROP COLUMN `queue_proc_msid`;
+
+ALTER TABLE `cloud`.`sync_queue_item` ADD `queue_proc_time` DATETIME NOT NULL COMMENT 'when processing started for the item' AFTER `queue_proc_number`;
+
+ALTER TABLE `cloud`.`sync_queue_item` ADD INDEX `i_sync_queue__queue_proc_time`(`queue_proc_time`);
 
 ALTER TABLE `cloud`.`inline_load_balancer_nic_map` DROP FOREIGN KEY fk_inline_load_balancer_nic_map__load_balancer_id;
 
@@ -253,7 +262,7 @@ UPDATE `cloud`.`swift` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`upload` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`user` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`user_ip_address` set uuid=id WHERE uuid is NULL;
-UPDATE `cloud`.`user_vm_temp` set uuid=id WHERE uuid is NULL;
+-- UPDATE `cloud`.`user_vm_temp` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`virtual_router_providers` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`virtual_supervisor_module` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`vlan` set uuid=id WHERE uuid is NULL;
@@ -264,23 +273,258 @@ UPDATE `cloud`.`vpc_gateways` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`vpc_offerings` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`vpn_users` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`volumes` set uuid=id WHERE uuid is NULL;
-UPDATE `cloud`.`autoscale_vmgroups` set uuid=id WHERE uuid is NULL;
-UPDATE `cloud`.`autoscale_vmprofiles` set uuid=id WHERE uuid is NULL;
-UPDATE `cloud`.`autoscale_policies` set uuid=id WHERE uuid is NULL;
-UPDATE `cloud`.`counter` set uuid=id WHERE uuid is NULL;
-UPDATE `cloud`.`conditions` set uuid=id WHERE uuid is NULL;
+-- UPDATE `cloud`.`autoscale_vmgroups` set uuid=id WHERE uuid is NULL;
+-- UPDATE `cloud`.`autoscale_vmprofiles` set uuid=id WHERE uuid is NULL;
+-- UPDATE `cloud`.`autoscale_policies` set uuid=id WHERE uuid is NULL;
+-- UPDATE `cloud`.`counter` set uuid=id WHERE uuid is NULL;
+-- UPDATE `cloud`.`conditions` set uuid=id WHERE uuid is NULL;
 
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'detail.batch.query.size', '2000', 'Default entity detail batch query size for listing');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'api.throttling.interval', '1', 'Time interval (in seconds) to reset API count');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'api.throttling.max', '25', 'Max allowed number of APIs within fixed interval');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'api.throttling.cachesize', '50000', 'Account based API count cache size');
 
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.pool.size', '500', 'Default size for DirectAgentPool');
+
+ALTER TABLE `cloud`.`op_dc_vnet_alloc` DROP INDEX i_op_dc_vnet_alloc__vnet__data_center_id;
+
+ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD CONSTRAINT UNIQUE `i_op_dc_vnet_alloc__vnet__data_center_id`(`vnet`, `physical_network_id`, `data_center_id`);
+
+CREATE TABLE  `cloud`.`region` (
+  `id` int unsigned NOT NULL UNIQUE,
+  `name` varchar(255) NOT NULL UNIQUE,
+  `end_point` varchar(255) NOT NULL,
+  `api_key` varchar(255),
+  `secret_key` varchar(255),
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`region_sync` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `region_id` int unsigned NOT NULL,
+  `api` varchar(1024) NOT NULL,
+  `created` datetime NOT NULL COMMENT 'date created',
+  `processed` tinyint NOT NULL default '0',
+  PRIMARY KEY  (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- INSERT INTO `cloud`.`region` values ('1','Local','http://localhost:8080/client/api','','');
+ALTER TABLE `cloud`.`account` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
+ALTER TABLE `cloud`.`user` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
+ALTER TABLE `cloud`.`domain` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
+
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.cpus', '40', 'The default maximum number of cpu cores that can be used for an account');
+
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.memory', '40960', 'The default maximum memory (in MB) that can be used for an account');
+
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.cpus', '40', 'The default maximum number of cpu cores that can be used for a project');
+
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.memory', '40960', 'The default maximum memory (in MB) that can be used for a project');
+
+ALTER TABLE `cloud_usage`.`account` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
+
+CREATE TABLE `cloud`.`nicira_nvp_router_map` (
+  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `logicalrouter_uuid` varchar(255) NOT NULL UNIQUE COMMENT 'nicira uuid of logical router',
+  `network_id` bigint unsigned NOT NULL UNIQUE COMMENT 'cloudstack id of the network',
+  PRIMARY KEY (`id`),
+  CONSTRAINT `fk_nicira_nvp_router_map__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`external_bigswitch_vns_devices` (
+  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `uuid` varchar(255) UNIQUE,
+  `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which bigswitch vns device is added',
+  `provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name corresponding to this bigswitch vns device',
+  `device_name` varchar(255) NOT NULL COMMENT 'name of the bigswitch vns device',
+  `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external bigswitch vns device',
+  PRIMARY KEY  (`id`),
+  CONSTRAINT `fk_external_bigswitch_vns_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_external_bigswitch_vns_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`counter` (
+  `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
+  `uuid` varchar(40),
+  `source` varchar(255) NOT NULL COMMENT 'source e.g. netscaler, snmp',
+  `name` varchar(255) NOT NULL COMMENT 'Counter name',
+  `value` varchar(255) NOT NULL COMMENT 'Value in case of source=snmp',
+  `removed` datetime COMMENT 'date removed if not null',
+  `created` datetime NOT NULL COMMENT 'date created',
+  PRIMARY KEY (`id`),
+  CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`),
+  INDEX `i_counter__removed`(`removed`),
+  INDEX `i_counter__source`(`source`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`conditions` (
+  `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id',
+  `uuid` varchar(40),
+  `counter_id` bigint unsigned NOT NULL COMMENT 'Counter Id',
+  `threshold` bigint unsigned NOT NULL COMMENT 'threshold value for the given counter',
+  `relational_operator` char(2) COMMENT 'relational operator to be used upon the counter and condition',
+  `domain_id` bigint unsigned NOT NULL COMMENT 'domain the Condition belongs to',
+  `account_id` bigint unsigned NOT NULL COMMENT 'owner of this Condition',
+  `removed` datetime COMMENT 'date removed if not null',
+  `created` datetime NOT NULL COMMENT 'date created',
+  PRIMARY KEY (`id`),
+  CONSTRAINT `fk_conditions__counter_id` FOREIGN KEY `fk_condition__counter_id`(`counter_id`) REFERENCES `counter`(`id`),
+  CONSTRAINT `fk_conditions__account_id` FOREIGN KEY `fk_condition__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_conditions__domain_id` FOREIGN KEY `fk_condition__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`),
+  INDEX `i_conditions__removed`(`removed`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`autoscale_vmprofiles` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `uuid` varchar(40),
+  `zone_id` bigint unsigned NOT NULL,
+  `domain_id` bigint unsigned NOT NULL,
+  `account_id` bigint unsigned NOT NULL,
+  `autoscale_user_id` bigint unsigned NOT NULL,
+  `service_offering_id` bigint unsigned NOT NULL,
+  `template_id` bigint unsigned NOT NULL,
+  `other_deploy_params` varchar(1024) COMMENT 'other deployment parameters that is in addition to zoneid,serviceofferingid,domainid',
+  `destroy_vm_grace_period` int unsigned COMMENT 'the time allowed for existing connections to get closed before a vm is destroyed',
+  `counter_params` varchar(1024) COMMENT 'the parameters for the counter to be used to get metric information from VMs',
+  `created` datetime NOT NULL COMMENT 'date created',
+  `removed` datetime COMMENT 'date removed if not null',
+  PRIMARY KEY  (`id`),
+  CONSTRAINT `fk_autoscale_vmprofiles__domain_id` FOREIGN KEY `fk_autoscale_vmprofiles__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_vmprofiles__account_id` FOREIGN KEY `fk_autoscale_vmprofiles__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_vmprofiles__autoscale_user_id` FOREIGN KEY `fk_autoscale_vmprofiles__autoscale_user_id` (`autoscale_user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`),
+  INDEX `i_autoscale_vmprofiles__removed`(`removed`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`autoscale_policies` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `uuid` varchar(40),
+  `domain_id` bigint unsigned NOT NULL,
+  `account_id` bigint unsigned NOT NULL,
+  `duration` int unsigned NOT NULL,
+  `quiet_time` int unsigned NOT NULL,
+  `action` varchar(15),
+  `created` datetime NOT NULL COMMENT 'date created',
+  `removed` datetime COMMENT 'date removed if not null',
+  PRIMARY KEY  (`id`),
+  CONSTRAINT `fk_autoscale_policies__domain_id` FOREIGN KEY `fk_autoscale_policies__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_policies__account_id` FOREIGN KEY `fk_autoscale_policies__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`),
+  INDEX `i_autoscale_policies__removed`(`removed`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`autoscale_vmgroups` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `uuid` varchar(40),
+  `zone_id` bigint unsigned NOT NULL,
+  `domain_id` bigint unsigned NOT NULL,
+  `account_id` bigint unsigned NOT NULL,
+  `load_balancer_id` bigint unsigned NOT NULL,
+  `min_members` int unsigned DEFAULT 1,
+  `max_members` int unsigned NOT NULL,
+  `member_port` int unsigned NOT NULL,
+  `interval` int unsigned NOT NULL,
+  `profile_id` bigint unsigned NOT NULL,
+  `state` varchar(255) NOT NULL COMMENT 'enabled or disabled, a vmgroup is disabled to stop autoscaling activity',
+  `created` datetime NOT NULL COMMENT 'date created',
+  `removed` datetime COMMENT 'date removed if not null',
+  PRIMARY KEY  (`id`),
+  CONSTRAINT `fk_autoscale_vmgroup__autoscale_vmprofile_id` FOREIGN KEY(`profile_id`) REFERENCES `autoscale_vmprofiles`(`id`),
+  CONSTRAINT `fk_autoscale_vmgroup__load_balancer_id` FOREIGN KEY(`load_balancer_id`) REFERENCES `load_balancing_rules`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_vmgroups__domain_id` FOREIGN KEY `fk_autoscale_vmgroups__domain_id` (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_vmgroups__account_id` FOREIGN KEY `fk_autoscale_vmgroups__account_id` (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_vmgroups__zone_id` FOREIGN KEY `fk_autoscale_vmgroups__zone_id`(`zone_id`) REFERENCES `data_center`(`id`),
+  CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`),
+  INDEX `i_autoscale_vmgroups__removed`(`removed`),
+  INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`autoscale_policy_condition_map` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `policy_id` bigint unsigned NOT NULL,
+  `condition_id` bigint unsigned NOT NULL,
+  PRIMARY KEY  (`id`),
+  CONSTRAINT `fk_autoscale_policy_condition_map__policy_id` FOREIGN KEY `fk_autoscale_policy_condition_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id` (`condition_id`) REFERENCES `conditions` (`id`),
+  INDEX `i_autoscale_policy_condition_map__policy_id`(`policy_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `vmgroup_id` bigint unsigned NOT NULL,
+  `policy_id` bigint unsigned NOT NULL,
+  PRIMARY KEY  (`id`),
+  CONSTRAINT `fk_autoscale_vmgroup_policy_map__vmgroup_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__vmgroup_id` (`vmgroup_id`) REFERENCES `autoscale_vmgroups` (`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id` (`policy_id`) REFERENCES `autoscale_policies` (`id`),
+  INDEX `i_autoscale_vmgroup_policy_map__vmgroup_id`(`vmgroup_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1, UUID(), 'snmp','Linux User CPU - percentage', '1.3.6.1.4.1.2021.11.9.0', now());
+INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (2, UUID(), 'snmp','Linux System CPU - percentage', '1.3.6.1.4.1.2021.11.10.0', now());
+INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (3, UUID(), 'snmp','Linux CPU Idle - percentage', '1.3.6.1.4.1.2021.11.11.0', now());
+INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (100, UUID(), 'netscaler','Response Time - microseconds', 'RESPTIME', now());
+CREATE TABLE `cloud`.`vm_snapshots` (
+  `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key',
+  `uuid` varchar(40) NOT NULL,
+  `name` varchar(255) NOT NULL,
+  `display_name` varchar(255) default NULL,
+  `description` varchar(255) default NULL,
+  `vm_id` bigint(20) unsigned NOT NULL,
+  `account_id` bigint(20) unsigned NOT NULL,
+  `domain_id` bigint(20) unsigned NOT NULL,
+  `vm_snapshot_type` varchar(32) default NULL,
+  `state` varchar(32) NOT NULL,
+  `parent` bigint unsigned default NULL,
+  `current` int(1) unsigned default NULL,
+  `update_count` bigint unsigned NOT NULL DEFAULT 0,
+  `updated` datetime default NULL,
+  `created` datetime default NULL,
+  `removed` datetime default NULL,
+  PRIMARY KEY  (`id`),
+  CONSTRAINT UNIQUE KEY `uc_vm_snapshots_uuid` (`uuid`),
+  INDEX `vm_snapshots_name` (`name`),
+  INDEX `vm_snapshots_vm_id` (`vm_id`),
+  INDEX `vm_snapshots_account_id` (`account_id`),
+  INDEX `vm_snapshots_display_name` (`display_name`),
+  INDEX `vm_snapshots_removed` (`removed`),
+  INDEX `vm_snapshots_parent` (`parent`),
+  CONSTRAINT `fk_vm_snapshots_vm_id__vm_instance_id` FOREIGN KEY `fk_vm_snapshots_vm_id__vm_instance_id` (`vm_id`) REFERENCES `vm_instance` (`id`),
+  CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`),
+  CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE  `cloud`.`user_ipv6_address` (
+  `id` bigint unsigned NOT NULL UNIQUE auto_increment,
+  `uuid` varchar(40),
+  `account_id` bigint unsigned NULL,
+  `domain_id` bigint unsigned NULL,
+  `ip_address` char(50) NOT NULL,
+  `data_center_id` bigint unsigned NOT NULL COMMENT 'zone that it belongs to',
+  `vlan_id` bigint unsigned NOT NULL,
+  `state` char(32) NOT NULL default 'Free' COMMENT 'state of the ip address',
+  `mac_address` varchar(40) NOT NULL COMMENT 'mac address of this ip',
+  `source_network_id` bigint unsigned NOT NULL COMMENT 'network id ip belongs to',
+  `network_id` bigint unsigned COMMENT 'network this public ip address is associated with',
+  `physical_network_id` bigint unsigned NOT NULL COMMENT 'physical network id that this configuration is based on',
+  `created` datetime NULL COMMENT 'Date this ip was allocated to someone',
+  PRIMARY KEY (`id`),
+  UNIQUE (`ip_address`, `source_network_id`),
+  CONSTRAINT `fk_user_ipv6_address__source_network_id` FOREIGN KEY (`source_network_id`) REFERENCES `networks`(`id`),
+  CONSTRAINT `fk_user_ipv6_address__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`),
+  CONSTRAINT `fk_user_ipv6_address__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`),
+  CONSTRAINT `fk_user_ipv6_address__vlan_id` FOREIGN KEY (`vlan_id`) REFERENCES `vlan`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `fk_user_ipv6_address__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
+  CONSTRAINT `uc_user_ipv6_address__uuid` UNIQUE (`uuid`),
+  CONSTRAINT `fk_user_ipv6_address__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
 
 -- DB views for list api
 
 DROP VIEW IF EXISTS `cloud`.`user_vm_view`;
 CREATE VIEW `cloud`.`user_vm_view` AS
-    select 
+    select
         vm_instance.id id,
         vm_instance.name name,
         user_vm.display_name display_name,
@@ -445,7 +689,7 @@ CREATE VIEW `cloud`.`user_vm_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`domain_router_view`;
 CREATE VIEW `cloud`.`domain_router_view` AS
-    select 
+    select
         vm_instance.id id,
         vm_instance.name name,
         account.id account_id,
@@ -544,7 +788,7 @@ CREATE VIEW `cloud`.`domain_router_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`security_group_view`;
 CREATE VIEW `cloud`.`security_group_view` AS
-    select 
+    select
         security_group.id id,
         security_group.name name,
         security_group.description description,
@@ -603,7 +847,7 @@ CREATE VIEW `cloud`.`security_group_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`resource_tag_view`;
 CREATE VIEW `cloud`.`resource_tag_view` AS
-    select 
+    select
         resource_tags.id,
         resource_tags.uuid,
         resource_tags.key,
@@ -635,7 +879,7 @@ CREATE VIEW `cloud`.`resource_tag_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`event_view`;
 CREATE VIEW `cloud`.`event_view` AS
-    select 
+    select
         event.id,
         event.uuid,
         event.type,
@@ -674,7 +918,7 @@ CREATE VIEW `cloud`.`event_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`instance_group_view`;
 CREATE VIEW `cloud`.`instance_group_view` AS
-    select 
+    select
         instance_group.id,
         instance_group.uuid,
         instance_group.name,
@@ -702,7 +946,7 @@ CREATE VIEW `cloud`.`instance_group_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`user_view`;
 CREATE VIEW `cloud`.`user_view` AS
-    select 
+    select
         user.id,
         user.uuid,
         user.username,
@@ -745,7 +989,7 @@ CREATE VIEW `cloud`.`user_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`project_view`;
 CREATE VIEW `cloud`.`project_view` AS
-    select 
+    select
         projects.id,
         projects.uuid,
         projects.name,
@@ -786,7 +1030,7 @@ CREATE VIEW `cloud`.`project_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`project_account_view`;
 CREATE VIEW `cloud`.`project_account_view` AS
-    select 
+    select
         project_account.id,
         account.id account_id,
         account.uuid account_uuid,
@@ -811,7 +1055,7 @@ CREATE VIEW `cloud`.`project_account_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`project_invitation_view`;
 CREATE VIEW `cloud`.`project_invitation_view` AS
-    select 
+    select
         project_invitations.id,
         project_invitations.uuid,
         project_invitations.email,
@@ -839,7 +1083,7 @@ CREATE VIEW `cloud`.`project_invitation_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`host_view`;
 CREATE VIEW `cloud`.`host_view` AS
-    select 
+    select
         host.id,
         host.uuid,
         host.name,
@@ -909,7 +1153,7 @@ CREATE VIEW `cloud`.`host_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`volume_view`;
 CREATE VIEW `cloud`.`volume_view` AS
-    select 
+    select
         volumes.id,
         volumes.uuid,
         volumes.name,
@@ -1010,7 +1254,7 @@ CREATE VIEW `cloud`.`volume_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`account_netstats_view`;
 CREATE VIEW `cloud`.`account_netstats_view` AS
-    SELECT 
+    SELECT
         account_id,
         sum(net_bytes_received) + sum(current_bytes_received) as bytesReceived,
         sum(net_bytes_sent) + sum(current_bytes_sent) as bytesSent
@@ -1021,7 +1265,7 @@ CREATE VIEW `cloud`.`account_netstats_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`account_vmstats_view`;
 CREATE VIEW `cloud`.`account_vmstats_view` AS
-    SELECT 
+    SELECT
         account_id, state, count(*) as vmcount
     from
         `cloud`.`vm_instance`
@@ -1029,7 +1273,7 @@ CREATE VIEW `cloud`.`account_vmstats_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`free_ip_view`;
 CREATE VIEW `cloud`.`free_ip_view` AS
-    select 
+    select
         count(user_ip_address.id) free_ip
     from
         `cloud`.`user_ip_address`
@@ -1041,7 +1285,7 @@ CREATE VIEW `cloud`.`free_ip_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`account_view`;
 CREATE VIEW `cloud`.`account_view` AS
-    select 
+    select
         account.id,
         account.uuid,
         account.account_name,
@@ -1168,7 +1412,7 @@ CREATE VIEW `cloud`.`account_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`async_job_view`;
 CREATE VIEW `cloud`.`async_job_view` AS
-    select 
+    select
         account.id account_id,
         account.uuid account_uuid,
         account.account_name account_name,
@@ -1277,7 +1521,7 @@ CREATE VIEW `cloud`.`async_job_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`storage_pool_view`;
 CREATE VIEW `cloud`.`storage_pool_view` AS
-    select 
+    select
         storage_pool.id,
         storage_pool.uuid,
         storage_pool.name,
@@ -1326,7 +1570,7 @@ CREATE VIEW `cloud`.`storage_pool_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`disk_offering_view`;
 CREATE VIEW `cloud`.`disk_offering_view` AS
-    select 
+    select
         disk_offering.id,
         disk_offering.uuid,
         disk_offering.name,
@@ -1351,7 +1595,7 @@ CREATE VIEW `cloud`.`disk_offering_view` AS
 
 DROP VIEW IF EXISTS `cloud`.`service_offering_view`;
 CREATE VIEW `cloud`.`service_offering_view` AS
-    select 
+    select
         service_offering.id,
         disk_offering.uuid,
         disk_offering.name,
@@ -1382,10 +1626,10 @@ CREATE VIEW `cloud`.`service_offering_view` AS
         `cloud`.`disk_offering` ON service_offering.id = disk_offering.id
             left join
         `cloud`.`domain` ON disk_offering.domain_id = domain.id;
-        
+
 DROP VIEW IF EXISTS `cloud`.`data_center_view`;
 CREATE VIEW `cloud`.`data_center_view` AS
-    select 
+    select
         data_center.id,
         data_center.uuid,
         data_center.name,
@@ -1410,43 +1654,5 @@ CREATE VIEW `cloud`.`data_center_view` AS
     from
         `cloud`.`data_center`
             left join
-        `cloud`.`domain` ON data_center.domain_id = domain.id;               
-        
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'management-server', 'direct.agent.pool.size', '500', 'Default size for DirectAgentPool');
-
-ALTER TABLE `cloud`.`op_dc_vnet_alloc` DROP INDEX i_op_dc_vnet_alloc__vnet__data_center_id;
-
-ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD CONSTRAINT UNIQUE `i_op_dc_vnet_alloc__vnet__data_center_id`(`vnet`, `physical_network_id`, `data_center_id`);
-
-CREATE TABLE  `cloud`.`region` (
-  `id` int unsigned NOT NULL UNIQUE,
-  `name` varchar(255) NOT NULL UNIQUE,
-  `end_point` varchar(255) NOT NULL,
-  `api_key` varchar(255),
-  `secret_key` varchar(255),
-  PRIMARY KEY  (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-CREATE TABLE `cloud`.`region_sync` (
-  `id` bigint unsigned NOT NULL auto_increment,
-  `region_id` int unsigned NOT NULL,
-  `api` varchar(1024) NOT NULL,
-  `created` datetime NOT NULL COMMENT 'date created',
-  `processed` tinyint NOT NULL default '0',
-  PRIMARY KEY  (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-INSERT INTO `cloud`.`region` values ('1','Local','http://localhost:8080/client/api','','');
-ALTER TABLE `cloud`.`account` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
-ALTER TABLE `cloud`.`user` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
-ALTER TABLE `cloud`.`domain` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';
-
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.cpus', '40', 'The default maximum number of cpu cores that can be used for an account');
-
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Account Defaults', 'DEFAULT', 'management-server', 'max.account.memory', '40960', 'The default maximum memory (in MB) that can be used for an account');
-
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.cpus', '40', 'The default maximum number of cpu cores that can be used for a project');
-
-INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.memory', '40960', 'The default maximum memory (in MB) that can be used for a project');
+        `cloud`.`domain` ON data_center.domain_id = domain.id;
 
-ALTER TABLE `cloud_usage`.`account` ADD COLUMN `region_id` int unsigned NOT NULL DEFAULT '1';


Mime
View raw message