You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2013/08/28 07:05:29 UTC
[1/3] git commit: updated refs/heads/4.2 to 75dff7c
Updated Branches:
refs/heads/4.2 8268a8ee3 -> 75dff7cc7
CLOUDSTACK-4530:Create Template from a Snapshot fails with unable to
find any snapshot ova/ovf when we have multiple secondary storage for a
zone.
(cherry picked from commit 4ba68e3b3fd58bd1e7333bb68e8970b3af7a954f)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ddc4990a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ddc4990a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ddc4990a
Branch: refs/heads/4.2
Commit: ddc4990a0dc9d9dca5c8cc707cb8678a83795717
Parents: 8268a8e
Author: Min Chen <mi...@citrix.com>
Authored: Tue Aug 27 16:56:21 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Aug 27 21:56:03 2013 -0700
----------------------------------------------------------------------
server/src/com/cloud/template/TemplateManagerImpl.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ddc4990a/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 2a0e04d..fa92a02 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1374,6 +1374,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
AsyncCallFuture<TemplateApiResult> future = null;
if (snapshotId != null) {
SnapshotInfo snapInfo = this._snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
+ DataStore snapStore = snapInfo.getDataStore();
+ if ( snapStore != null ){
+ store = snapStore; // pick snapshot image store to create template
+ }
future = this._tmpltSvr.createTemplateFromSnapshotAsync(snapInfo, tmplInfo, store);
} else if (volumeId != null) {
VolumeInfo volInfo = this._volFactory.getVolume(volumeId);
[3/3] git commit: updated refs/heads/4.2 to 75dff7c
Posted by an...@apache.org.
CLOUDSTACK-2121. DOC. Add procedure for deleting affinity groups. Replace button icon with smaller version.
(cherry picked from commit 042d44f0341c8abc47f51ca4e2339784b411d9ce)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/75dff7cc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/75dff7cc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/75dff7cc
Branch: refs/heads/4.2
Commit: 75dff7cc78eafac9a7723f3e97b5c13502b44e23
Parents: 85507c2
Author: Jessica <je...@citrix.com>
Authored: Tue Aug 27 21:32:47 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Aug 27 21:57:15 2013 -0700
----------------------------------------------------------------------
docs/en-US/host-allocation.xml | 11 +++++++++++
docs/en-US/images/change-affinity-button.png | Bin 8570 -> 7300 bytes
2 files changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75dff7cc/docs/en-US/host-allocation.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/host-allocation.xml b/docs/en-US/host-allocation.xml
index 9e752af..36baee5 100644
--- a/docs/en-US/host-allocation.xml
+++ b/docs/en-US/host-allocation.xml
@@ -108,5 +108,16 @@
<listitem><para>Click View Instances. The members of the group are listed.</para>
<para>From here, you can click the name of any VM in the list to access all its details and controls.</para></listitem>
</orderedlist>
+ <formalpara><title>Delete an Affinity Group</title>
+ <para>To delete an affinity group:</para></formalpara>
+ <orderedlist>
+ <listitem><para>In the left navigation bar, click Affinity Groups.</para></listitem>
+ <listitem><para>Click the name of the group you are interested in.</para></listitem>
+ <listitem><para>Click Delete.</para>
+ <para>Any VM that is a member of the affinity group will be disassociated from the group.
+ The former group members will continue to run normally on the current hosts, but if the
+ VM is restarted, it will no longer follow the host allocation rules from its former
+ affinity group.</para></listitem>
+ </orderedlist>
</section>
</section>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/75dff7cc/docs/en-US/images/change-affinity-button.png
----------------------------------------------------------------------
diff --git a/docs/en-US/images/change-affinity-button.png b/docs/en-US/images/change-affinity-button.png
index 36b4ae3..c21ef75 100644
Binary files a/docs/en-US/images/change-affinity-button.png and b/docs/en-US/images/change-affinity-button.png differ
[2/3] git commit: updated refs/heads/4.2 to 75dff7c
Posted by an...@apache.org.
CLOUDSTACK-4464,CLOUDSTACK-4529: use property collector to collect all information in one round, we have a few other places that need to do it the same way
(cherry picked from commit 4c6ec5f3c63cb486566d9260e77d2f21c79d9c07)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/85507c23
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/85507c23
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/85507c23
Branch: refs/heads/4.2
Commit: 85507c236663379e06ee0ccf7e17ccb4991f4a99
Parents: ddc4990
Author: Kelven Yang <ke...@gmail.com>
Authored: Tue Aug 27 17:37:39 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Aug 27 21:56:46 2013 -0700
----------------------------------------------------------------------
.../vmware/resource/VmwareResource.java | 53 ++++++++++++++------
.../cloud/hypervisor/vmware/mo/ClusterMO.java | 31 ++++++------
.../com/cloud/hypervisor/vmware/mo/HostMO.java | 15 ++++--
.../vmware/mo/HypervisorHostHelper.java | 18 +++----
4 files changed, 74 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85507c23/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 63d0482..fd88c7e 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -277,6 +277,7 @@ import com.vmware.vim25.AboutInfo;
import com.vmware.vim25.BoolPolicy;
import com.vmware.vim25.ClusterDasConfigInfo;
import com.vmware.vim25.ComputeResourceSummary;
+import com.vmware.vim25.CustomFieldStringValue;
import com.vmware.vim25.DVPortConfigInfo;
import com.vmware.vim25.DVPortConfigSpec;
import com.vmware.vim25.DatastoreSummary;
@@ -5799,10 +5800,16 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
if(_recycleHungWorker) {
s_logger.info("Scan hung worker VM to recycle");
+
+ int key = ((HostMO)hyperHost).getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
+ }
+ String instanceNameCustomField = "value[" + key + "]";
// GC worker that has been running for too long
ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(
- new String[] {"name", "config.template", "runtime.powerState", "runtime.bootTime"});
+ new String[] {"name", "config.template", "runtime.powerState", "runtime.bootTime", instanceNameCustomField });
if(ocs != null) {
for(ObjectContent oc : ocs) {
List<DynamicProperty> props = oc.getPropSet();
@@ -5816,6 +5823,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
for(DynamicProperty prop : props) {
if (prop.getName().equals("name"))
vmName = prop.getVal().toString();
+ else if(prop.getName().startsWith("value[")) {
+ if(prop.getVal() != null)
+ internalName = ((CustomFieldStringValue)prop.getVal()).getValue();
+ }
else if(prop.getName().equals("config.template"))
template = (Boolean)prop.getVal();
else if(prop.getName().equals("runtime.powerState"))
@@ -5825,15 +5836,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
}
VirtualMachineMO vmMo = new VirtualMachineMO(hyperHost.getContext(), oc.getObj());
- // Check if vmMo has the custom property CLOUD_VM_INTERNAL_NAME set.
- internalName = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
-
String name = null;
if (internalName != null) {
name = internalName;
} else {
name = vmName;
}
+
if(!template && name.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) {
boolean recycle = false;
@@ -6274,9 +6283,16 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
private HashMap<String, State> getVmStates() throws Exception {
VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
+
+ int key = ((HostMO)hyperHost).getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
+ }
+ String instanceNameCustomField = "value[" + key + "]";
+
// CLOUD_VM_INTERNAL_NAME stores the internal CS generated vm name. This was earlier stored in name. Now, name can be either the hostname or
// the internal CS name, but the custom field CLOUD_VM_INTERNAL_NAME always stores the internal CS name.
- ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] { "name", "runtime.powerState", "config.template" });
+ ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] { "name", "runtime.powerState", "config.template", instanceNameCustomField });
HashMap<String, State> newStates = new HashMap<String, State>();
if (ocs != null && ocs.length > 0) {
@@ -6297,13 +6313,15 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
powerState = (VirtualMachinePowerState) objProp.getVal();
} else if (objProp.getName().equals("name")) {
name = (String) objProp.getVal();
- } else {
+ } else if(objProp.getName().contains(instanceNameCustomField)) {
+ if(objProp.getVal() != null)
+ VMInternalCSName = ((CustomFieldStringValue)objProp.getVal()).getValue();
+ }
+ else {
assert (false);
}
}
- VirtualMachineMO vmMo = new VirtualMachineMO(hyperHost.getContext(), oc.getObj());
- // Check if vmMo has the custom property CLOUD_VM_INTERNAL_NAME set.
- VMInternalCSName = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+
if (VMInternalCSName != null)
name = VMInternalCSName;
@@ -6335,8 +6353,14 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
}
}
}
+
+ int key = ((HostMO)hyperHost).getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
+ }
+ String instanceNameCustomField = "value[" + key + "]";
- ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] {"name", "summary.config.numCpu", "summary.quickStats.overallCpuUsage"});
+ ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] {"name", "summary.config.numCpu", "summary.quickStats.overallCpuUsage", instanceNameCustomField});
if (ocs != null && ocs.length > 0) {
for (ObjectContent oc : ocs) {
List<DynamicProperty> objProps = oc.getPropSet();
@@ -6349,16 +6373,17 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
for (DynamicProperty objProp : objProps) {
if (objProp.getName().equals("name")) {
vmNameOnVcenter = objProp.getVal().toString();
- } else if (objProp.getName().equals("summary.config.numCpu")) {
+ } else if(objProp.getName().contains(instanceNameCustomField)) {
+ if(objProp.getVal() != null)
+ vmInternalCSName = ((CustomFieldStringValue)objProp.getVal()).getValue();
+ }
+ else if (objProp.getName().equals("summary.config.numCpu")) {
numberCPUs = objProp.getVal().toString();
} else if (objProp.getName().equals("summary.quickStats.overallCpuUsage")) {
maxCpuUsage = objProp.getVal().toString();
}
}
VirtualMachineMO vmMo = new VirtualMachineMO(hyperHost.getContext(), oc.getObj());
- // Check if vmMo has the custom property CLOUD_VM_INTERNAL_NAME set.
- vmInternalCSName = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
-
if (vmInternalCSName != null) {
name = vmInternalCSName;
} else {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85507c23/vmware-base/src/com/cloud/hypervisor/vmware/mo/ClusterMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/ClusterMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/ClusterMO.java
index d1a4530..b91d9f4 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/ClusterMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/ClusterMO.java
@@ -98,25 +98,28 @@ public class ClusterMO extends BaseMO implements VmwareHypervisorHost {
@Override
public VirtualMachineMO findVmOnHyperHost(String name) throws Exception {
- ObjectContent[] ocs = getVmPropertiesOnHyperHost(new String[] { "name" });
- return HypervisorHostHelper.findVmFromObjectContent(_context, ocs, name);
+
+ int key = getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
+ }
+
+ String instanceNameCustomField = "value[" + key + "]";
+ ObjectContent[] ocs = getVmPropertiesOnHyperHost(new String[] { "name", instanceNameCustomField });
+ return HypervisorHostHelper.findVmFromObjectContent(_context, ocs, name, instanceNameCustomField);
}
@Override
public VirtualMachineMO findVmOnPeerHyperHost(String name) throws Exception {
- ObjectContent[] ocs = getVmPropertiesOnHyperHost(new String[] { "name" });
- if(ocs != null && ocs.length > 0) {
- for(ObjectContent oc : ocs) {
- List<DynamicProperty> props = oc.getPropSet();
- if(props != null) {
- for(DynamicProperty prop : props) {
- if(prop.getVal().toString().equals(name))
- return new VirtualMachineMO(_context, oc.getObj());
- }
- }
- }
+ int key = getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
}
- return null;
+
+ String instanceNameCustomField = "value[" + key + "]";
+
+ ObjectContent[] ocs = getVmPropertiesOnHyperHost(new String[] { "name", instanceNameCustomField });
+ return HypervisorHostHelper.findVmFromObjectContent(_context, ocs, name, instanceNameCustomField);
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85507c23/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
index 49a340c..c350aa5 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
@@ -510,9 +510,14 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost {
_vmCache.clear();
+ int key = getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
+ }
+
// name is the name of the VM as it appears in vCenter. The CLOUD_VM_INTERNAL_NAME custom
// field value contains the name of the VM as it is maintained internally by cloudstack (i-x-y).
- ObjectContent[] ocs = getVmPropertiesOnHyperHost(new String[] { "name" });
+ ObjectContent[] ocs = getVmPropertiesOnHyperHost(new String[] { "name", "value[" + key + "]" });
if(ocs != null && ocs.length > 0) {
for(ObjectContent oc : ocs) {
List<DynamicProperty> props = oc.getPropSet();
@@ -522,11 +527,11 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost {
for (DynamicProperty prop : props) {
if (prop.getName().equals("name")) {
vmVcenterName = prop.getVal().toString();
- }
+ } else if(prop.getName().startsWith("value[")) {
+ if(prop.getVal() != null)
+ vmInternalCSName = ((CustomFieldStringValue)prop.getVal()).getValue();
+ }
}
- VirtualMachineMO vmMo = new VirtualMachineMO(_context, oc.getObj());
- // Check if vmMo has the custom property CLOUD_VM_INTERNAL_NAME set.
- vmInternalCSName = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
String vmName = null;
if (vmInternalCSName != null && isUserVMInternalCSName(vmInternalCSName)) {
vmName = vmInternalCSName;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/85507c23/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index db4fe73..43c59fc 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -44,6 +44,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.net.NetUtils;
import com.vmware.vim25.AlreadyExistsFaultMsg;
import com.vmware.vim25.BoolPolicy;
+import com.vmware.vim25.CustomFieldStringValue;
import com.vmware.vim25.DVPortSetting;
import com.vmware.vim25.DVPortgroupConfigInfo;
import com.vmware.vim25.DVPortgroupConfigSpec;
@@ -61,7 +62,6 @@ import com.vmware.vim25.HttpNfcLeaseState;
import com.vmware.vim25.LongPolicy;
import com.vmware.vim25.ManagedObjectReference;
import com.vmware.vim25.ObjectContent;
-import com.vmware.vim25.OptionValue;
import com.vmware.vim25.OvfCreateImportSpecParams;
import com.vmware.vim25.OvfCreateImportSpecResult;
import com.vmware.vim25.OvfFileItem;
@@ -90,8 +90,8 @@ public class HypervisorHostHelper {
private static final String UNTAGGED_VLAN_NAME = "untagged";
public static VirtualMachineMO findVmFromObjectContent(VmwareContext context,
- ObjectContent[] ocs, String name) {
-
+ ObjectContent[] ocs, String name, String instanceNameCustomField) {
+
if(ocs != null && ocs.length > 0) {
for(ObjectContent oc : ocs) {
String vmNameInvCenter = null;
@@ -101,16 +101,14 @@ public class HypervisorHostHelper {
for(DynamicProperty objProp : objProps) {
if(objProp.getName().equals("name")) {
vmNameInvCenter = (String)objProp.getVal();
+ } else if(objProp.getName().contains(instanceNameCustomField)) {
+ if(objProp.getVal() != null)
+ vmInternalCSName = ((CustomFieldStringValue)objProp.getVal()).getValue();
}
- VirtualMachineMO vmMo = new VirtualMachineMO(context, oc.getObj());
- // Check if vmMo has the custom property CLOUD_VM_INTERNAL_NAME set.
- try {
- vmInternalCSName = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
- } catch (Exception e) {
- s_logger.error("Unable to retrieve custom field value for internal VM name");
- }
+
if ( (vmNameInvCenter != null && name.equalsIgnoreCase(vmNameInvCenter))
|| (vmInternalCSName != null && name.equalsIgnoreCase(vmInternalCSName)) ) {
+ VirtualMachineMO vmMo = new VirtualMachineMO(context, oc.getObj());
return vmMo;
}
}