cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [1/2] git commit: updated refs/heads/4.3 to 4dd38a9
Date Mon, 06 Jan 2014 13:10:55 GMT
Updated Branches:
  refs/heads/4.3 2b2d5998d -> 4dd38a9fb


CLOUDSTACK-5472 fixed the listvirtualmachines API to show cpu, memory and cpucores when using
custom compute offering


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

Branch: refs/heads/4.3
Commit: 4dd38a9fb09d13df6fd58bfc7ab19d37c0508308
Parents: 3a2cf48
Author: Bharat Kumar <bharat.kumar@citrix.com>
Authored: Thu Dec 26 14:28:31 2013 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Mon Jan 6 18:40:39 2014 +0530

----------------------------------------------------------------------
 setup/db/db/schema-420to421.sql | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4dd38a9f/setup/db/db/schema-420to421.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-420to421.sql b/setup/db/db/schema-420to421.sql
index c09a1bb..78687f2 100644
--- a/setup/db/db/schema-420to421.sql
+++ b/setup/db/db/schema-420to421.sql
@@ -92,9 +92,18 @@ CREATE VIEW `cloud`.`user_vm_view` AS
         iso.display_text iso_display_text,
         service_offering.id service_offering_id,
         disk_offering.uuid service_offering_uuid,
-        service_offering.cpu cpu,
-        service_offering.speed speed,
-        service_offering.ram_size ram_size,
+        Case
+             When (`cloud`.`service_offering`.`cpu` is null) then (`custom_cpu`.`value`)
+             Else ( `cloud`.`service_offering`.`cpu`)
+        End as `cpu`,
+        Case
+            When (`cloud`.`service_offering`.`speed` is null) then (`custom_speed`.`value`)
+            Else ( `cloud`.`service_offering`.`speed`)
+        End as `speed`,
+        Case
+            When (`cloud`.`service_offering`.`ram_size` is null) then (`custom_ram_size`.`value`)
+            Else ( `cloud`.`service_offering`.`ram_size`)
+        END as `ram_size`,
         disk_offering.name service_offering_name,
         storage_pool.id pool_id,
         storage_pool.uuid pool_uuid,
@@ -216,7 +225,13 @@ CREATE VIEW `cloud`.`user_vm_view` AS
             left join
         `cloud`.`affinity_group` ON affinity_group_vm_map.affinity_group_id = affinity_group.id
             left join
-        `cloud`.`user_vm_details` as all_details ON all_details.vm_id = vm_instance.id;
+        `cloud`.`user_vm_details` as all_details ON all_details.vm_id = vm_instance.id
+            left join
+        `cloud`.`user_vm_details` `custom_cpu`  ON (((`custom_cpu`.`vm_id` = `cloud`.`vm_instance`.`id`)
and (`custom_cpu`.`name` = 'CpuNumber')))
+            left join
+        `cloud`.`user_vm_details` `custom_speed`  ON (((`custom_speed`.`vm_id` = `cloud`.`vm_instance`.`id`)
and (`custom_speed`.`name` = 'CpuSpeed')))
+           left join
+        `cloud`.`user_vm_details` `custom_ram_size`  ON (((`custom_ram_size`.`vm_id` = `cloud`.`vm_instance`.`id`)
and (`custom_ram_size`.`name` = 'memory')));
 
 --Add the format for volumes table for uploaded volumes (CLOUDSTACK-5013)
 update  `cloud`.`volumes` v,  `cloud`.`volume_host_ref` vhr  set v.format=vhr.format where
v.id=vhr.volume_id and v.format is null;


Mime
View raw message