From 7f1168cec74c704257f2d6040cd352b240d5d299 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Thu, 21 Nov 2013 09:00:11 +0100 Subject: [PATCH] CLOUDSTACK-1302: Add cache mode to SQL upgrade file This got lost in the previous commit Not sure though if this is the right file, since this feature won't make it into 4.3, but there is no 4.4 file. --- setup/db/db/schema-421to430.sql | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql index 7dc475fa8d3..b2f17285977 100644 --- a/setup/db/db/schema-421to430.sql +++ b/setup/db/db/schema-421to430.sql @@ -120,6 +120,7 @@ UPDATE `cloud`.`configuration` SET `default_value` = `value`; #Upgrade the offerings and template table to have actual remove and states ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `state` CHAR(40) NOT NULL DEFAULT 'Active' COMMENT 'state for disk offering'; ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `hv_ss_reserve` int(32) unsigned DEFAULT NULL COMMENT 'Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)'; +ALTER TABLE `cloud`.`disk_offering` ADD `cache_mode` VARCHAR( 16 ) NOT NULL DEFAULT 'none' COMMENT 'The disk cache mode to use for disks created with this offering'; ALTER TABLE `cloud`.`volumes` ADD COLUMN `hv_ss_reserve` int(32) unsigned DEFAULT NULL COMMENT 'Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)'; @@ -156,6 +157,7 @@ CREATE VIEW `cloud`.`disk_offering_view` AS disk_offering.bytes_write_rate, disk_offering.iops_read_rate, disk_offering.iops_write_rate, + disk_offering.cache_mode, disk_offering.sort_key, disk_offering.type, disk_offering.display_offering, @@ -172,7 +174,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, @@ -186,6 +188,7 @@ CREATE VIEW `cloud`.`service_offering_view` AS disk_offering.bytes_write_rate, disk_offering.iops_read_rate, disk_offering.iops_write_rate, + disk_offering.cache_mode, service_offering.cpu, service_offering.speed, service_offering.ram_size, @@ -211,10 +214,10 @@ CREATE VIEW `cloud`.`service_offering_view` AS `cloud`.`domain` ON disk_offering.domain_id = domain.id where disk_offering.state='Active'; - + DROP VIEW IF EXISTS `cloud`.`template_view`; CREATE VIEW `cloud`.`template_view` AS - select + select vm_template.id, vm_template.uuid, vm_template.unique_name, @@ -255,7 +258,7 @@ CREATE VIEW `cloud`.`template_view` AS domain.path domain_path, projects.id project_id, projects.uuid project_uuid, - projects.name project_name, + projects.name project_name, data_center.id data_center_id, data_center.uuid data_center_uuid, data_center.name data_center_name, @@ -285,23 +288,23 @@ CREATE VIEW `cloud`.`template_view` AS from `cloud`.`vm_template` inner join - `cloud`.`guest_os` ON guest_os.id = vm_template.guest_os_id + `cloud`.`guest_os` ON guest_os.id = vm_template.guest_os_id inner join `cloud`.`account` ON account.id = vm_template.account_id inner join `cloud`.`domain` ON domain.id = account.domain_id left join - `cloud`.`projects` ON projects.project_account_id = account.id + `cloud`.`projects` ON projects.project_account_id = account.id left join - `cloud`.`vm_template_details` ON vm_template_details.template_id = vm_template.id + `cloud`.`vm_template_details` ON vm_template_details.template_id = vm_template.id left join - `cloud`.`vm_template` source_template ON source_template.id = vm_template.source_template_id + `cloud`.`vm_template` source_template ON source_template.id = vm_template.source_template_id left join `cloud`.`template_store_ref` ON template_store_ref.template_id = vm_template.id and template_store_ref.store_role = 'Image' left join - `cloud`.`image_store` ON image_store.removed is NULL AND template_store_ref.store_id is not NULL AND image_store.id = template_store_ref.store_id + `cloud`.`image_store` ON image_store.removed is NULL AND template_store_ref.store_id is not NULL AND image_store.id = template_store_ref.store_id left join - `cloud`.`template_zone_ref` ON template_zone_ref.template_id = vm_template.id AND template_store_ref.store_id is NULL AND template_zone_ref.removed is null + `cloud`.`template_zone_ref` ON template_zone_ref.template_id = vm_template.id AND template_store_ref.store_id is NULL AND template_zone_ref.removed is null left join `cloud`.`data_center` ON (image_store.data_center_id = data_center.id OR template_zone_ref.zone_id = data_center.id) left join @@ -367,6 +370,7 @@ CREATE VIEW `cloud`.`volume_view` AS disk_offering.bytes_write_rate, disk_offering.iops_read_rate, disk_offering.iops_write_rate, + disk_offering.cache_mode, storage_pool.id pool_id, storage_pool.uuid pool_uuid, storage_pool.name pool_name, @@ -420,7 +424,7 @@ CREATE VIEW `cloud`.`volume_view` AS `cloud`.`async_job` ON async_job.instance_id = volumes.id and async_job.instance_type = 'Volume' and async_job.job_status = 0; - + DROP VIEW IF EXISTS `cloud`.`storage_pool_view`; CREATE VIEW `cloud`.`storage_pool_view` AS select