You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/04/11 01:09:43 UTC

[20/50] git commit: updated refs/heads/internallb to ed0cb2f

1)use vmsnapshot.create.wait to control vmsnapshot timeout 2)remove global configuration vmsnapshot.expunge.interval and vmsnapshot.expunge.workers since vmsnapshot expunge is synchronous


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

Branch: refs/heads/internallb
Commit: 01fc4ffc24f9c01a9f60f2f68357685c687b500a
Parents: 7e1eda0
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Wed Apr 10 11:30:16 2013 +0800
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Apr 10 15:44:03 2013 -0700

----------------------------------------------------------------------
 .../xen/resource/CitrixResourceBase.java           |    2 +-
 server/src/com/cloud/configuration/Config.java     |    4 +-
 .../cloud/vm/snapshot/VMSnapshotManagerImpl.java   |    5 ++
 setup/db/db/schema-40to410.sql                     |   29 --------------
 setup/db/db/schema-410to420.sql                    |   30 ++++++++++++++-
 5 files changed, 36 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index c50f13c..4ef583a 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -6380,7 +6380,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         String guestOSType = cmd.getGuestOSType();
 
         boolean snapshotMemory = cmd.getTarget().getType() == VMSnapshot.Type.DiskAndMemory;
-        long timeout = 600;
+        long timeout = cmd.getWait();
 
         Connection conn = getConnection();
         VM vm = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 200943b..2137c00 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -397,9 +397,7 @@ public enum Config {
 	
 	// VMSnapshots
     VMSnapshotMax("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.max", "10", "Maximum vm snapshots for a vm", null),
-    VMSnapshotCreateWait("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.create.wait", "600", "In second, timeout for create vm snapshot", null),
-    VMSnapshotExpungeInterval("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.expunge.interval", "60", "The interval (in seconds) to wait before running the expunge thread.", null),
-    VMSnapshotExpungeWorkers("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.expunge.workers",  "1", "Number of workers performing expunge ", null),
+    VMSnapshotCreateWait("Advanced", VMSnapshotManager.class, Integer.class, "vmsnapshot.create.wait", "1800", "In second, timeout for create vm snapshot", null),
 
     CloudDnsName("Advanced", ManagementServer.class, String.class, "cloud.dns.name", "default", " DNS name of the cloud", null);
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index 638be6c..ffbbb82 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -120,6 +120,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
     @Inject DataStoreManager dataStoreMgr;
     @Inject ConfigurationDao _configDao;
     int _vmSnapshotMax;
+    int _wait;
     StateMachine2<VMSnapshot.State, VMSnapshot.Event, VMSnapshot> _vmSnapshottateMachine ;
 
     @Override
@@ -131,6 +132,9 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
         }
 
         _vmSnapshotMax = NumbersUtil.parseInt(_configDao.getValue("vmsnapshot.max"), VMSNAPSHOTMAX);
+        
+        String value = _configDao.getValue("vmsnapshot.create.wait");
+        _wait = NumbersUtil.parseInt(value, 1800);
 
         _vmSnapshottateMachine   = VMSnapshot.State.getStateMachine();
         return true;
@@ -361,6 +365,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
                 vmSnapshot.setParent(current.getId());
 
             CreateVMSnapshotCommand ccmd = new CreateVMSnapshotCommand(userVm.getInstanceName(),target ,volumeTOs, guestOS.getDisplayName(),userVm.getState());
+            ccmd.setWait(_wait);
             
             answer = (CreateVMSnapshotAnswer) sendToPool(hostId, ccmd);
             if (answer != null && answer.getResult()) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/setup/db/db/schema-40to410.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql
index fc15b94..e2949d9 100644
--- a/setup/db/db/schema-40to410.sql
+++ b/setup/db/db/schema-40to410.sql
@@ -404,35 +404,6 @@ INSERT INTO `cloud`.`counter` (id, uuid, source, name, value,created) VALUES (1,
 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,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01fc4ffc/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 7932763..7bb230e 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -415,10 +415,38 @@ INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type,
 
 -- END: support for LXC
 
-
 ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address` varchar(40) COMMENT 'source ip address for the load balancer rule';
 ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address_network_id` bigint unsigned COMMENT 'the id of the network where source ip belongs to';
 ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `scheme` varchar(40) NOT NULL COMMENT 'load balancer scheme; can be Internal or Public';
 UPDATE `cloud`.`load_balancing_rules` SET `scheme`='Public';
 
 
+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;