cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [39/41] git commit: Replace db-id by UUID for user VM's vm-id.
Date Wed, 12 Sep 2012 06:43:30 GMT
Replace db-id by UUID for user VM's vm-id.


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

Branch: refs/heads/4.0
Commit: 663e2503348c7b629fc914b5b2adad42a4d16ceb
Parents: 9095f0b
Author: Fang Wang <fang.wang@citrix.com>
Authored: Mon Sep 10 17:58:53 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Mon Sep 10 18:01:08 2012 -0700

----------------------------------------------------------------------
 api/src/com/cloud/vm/VirtualMachineProfile.java    |    5 +++++
 .../network/element/CloudZonesNetworkElement.java  |    6 +++---
 .../router/VirtualNetworkApplianceManagerImpl.java |    6 +++---
 .../com/cloud/vm/VirtualMachineProfileImpl.java    |    5 +++++
 4 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/663e2503/api/src/com/cloud/vm/VirtualMachineProfile.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VirtualMachineProfile.java b/api/src/com/cloud/vm/VirtualMachineProfile.java
index 30aed4e..57277db 100644
--- a/api/src/com/cloud/vm/VirtualMachineProfile.java
+++ b/api/src/com/cloud/vm/VirtualMachineProfile.java
@@ -104,6 +104,11 @@ public interface VirtualMachineProfile<T extends VirtualMachine>
{
      */
     long getId();
 
+    /**
+     * @return virtual machine uuid.
+     */
+    String getUuid();
+
     List<NicProfile> getNics();
 
     List<VolumeTO> getDisks();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/663e2503/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
index 5f93cac..6dc4be7 100644
--- a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
+++ b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
@@ -152,7 +152,7 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem
     }
 
     private VmDataCommand generateVmDataCommand(String vmPrivateIpAddress,
-            String userData, String serviceOffering, String zoneName, String guestIpAddress,
String vmName, String vmInstanceName, long vmId, String publicKey) {
+            String userData, String serviceOffering, String zoneName, String guestIpAddress,
String vmName, String vmInstanceName, String vmUuid, String publicKey) {
         VmDataCommand cmd = new VmDataCommand(vmPrivateIpAddress, vmName);
 
         cmd.addVmData("userdata", "user-data", userData);
@@ -163,7 +163,7 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem
         cmd.addVmData("metadata", "public-ipv4", guestIpAddress);
         cmd.addVmData("metadata", "public-hostname", guestIpAddress);
         cmd.addVmData("metadata", "instance-id", vmInstanceName);
-        cmd.addVmData("metadata", "vm-id", String.valueOf(vmId));
+        cmd.addVmData("metadata", "vm-id", vmUuid);
         cmd.addVmData("metadata", "public-keys", publicKey);
 
         return cmd;
@@ -213,7 +213,7 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem
             cmds.addCommand(
                     "vmdata",
                     generateVmDataCommand(nic.getIp4Address(), userData, serviceOffering,
zoneName, nic.getIp4Address(), uservm.getVirtualMachine().getHostName(), uservm.getVirtualMachine().getInstanceName(),
-                            uservm.getId(), sshPublicKey));
+                            uservm.getUuid(), sshPublicKey));
             try {
                 _agentManager.send(dest.getHost().getId(), cmds);
             } catch (OperationTimedoutException e) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/663e2503/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index bc92916..d5dd78c 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -695,7 +695,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
 
     private VmDataCommand generateVmDataCommand(VirtualRouter router, String vmPrivateIpAddress,
String userData, 
             String serviceOffering, String zoneName, String guestIpAddress, String vmName,
-            String vmInstanceName, long vmId, String publicKey, long guestNetworkId) {
+            String vmInstanceName, String vmUuid, String publicKey, long guestNetworkId)
{
         VmDataCommand cmd = new VmDataCommand(vmPrivateIpAddress, vmName);
 
         cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId()));
@@ -723,7 +723,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
             cmd.addVmData("metadata", "public-hostname", router.getPublicIpAddress());
         }
         cmd.addVmData("metadata", "instance-id", vmInstanceName);
-        cmd.addVmData("metadata", "vm-id", String.valueOf(vmId));
+        cmd.addVmData("metadata", "vm-id", vmUuid);
         cmd.addVmData("metadata", "public-keys", publicKey);
 
         String cloudIdentifier = _configDao.getValue("cloud.identifier");
@@ -2816,7 +2816,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
         String zoneName = _dcDao.findById(router.getDataCenterIdToDeployIn()).getName();
         cmds.addCommand("vmdata",
                 generateVmDataCommand(router, nic.getIp4Address(), vm.getUserData(), serviceOffering,
zoneName, nic.getIp4Address(),
-                        vm.getHostName(), vm.getInstanceName(), vm.getId(), publicKey, nic.getNetworkId()));
+                        vm.getHostName(), vm.getInstanceName(), vm.getUuid(), publicKey,
nic.getNetworkId()));
         
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/663e2503/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
index 6028c95..e83d6a0 100644
--- a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
@@ -128,6 +128,11 @@ public class VirtualMachineProfileImpl<T extends VMInstanceVO>
implements Virtua
         return _vm.getId();
     }
     
+    @Override
+    public String getUuid() {
+	return _vm.getUuid();
+    }
+
     public void setNics(List<NicProfile> nics) {
         _nics = nics;
     }


Mime
View raw message