Spaceman1984 commented on a change in pull request #4640:
URL: https://github.com/apache/cloudstack/pull/4640#discussion_r572761774
##########
File path:
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5260,6 +5269,66 @@ protected Answer execute(ModifyStoragePoolCommand cmd) {
}
}
+ protected Answer execute(GetStoragePoolCapabilitiesCommand cmd) {
+
+ try {
+
+ VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
+
+ HostMO host = (HostMO) hyperHost;
+
+ StorageFilerTO pool = cmd.getPool();
+
+ ManagedObjectReference morDatastore =
HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost,
pool.getUuid());
+
+ if (morDatastore == null) {
+ morDatastore = hyperHost.mountDatastore((pool.getType() ==
StoragePoolType.VMFS || pool.getType() == StoragePoolType.PreSetup ||
pool.getType() == StoragePoolType.DatastoreCluster), pool.getHost(),
pool.getPort(), pool.getPath(), pool.getUuid().replace("-", ""), true);
+ }
+
+ assert (morDatastore != null);
+
+ DatastoreMO dsMo = new DatastoreMO(getServiceContext(),
morDatastore);
+
+ GetStoragePoolCapabilitiesAnswer answer = new
GetStoragePoolCapabilitiesAnswer(cmd);
+
+ if (pool.getType() == StoragePoolType.NetworkFilesystem) {
+ boolean hardwareAccelerationSupportForDataStore =
getHardwareAccelerationSupportForDataStore(host.getMor(), dsMo.getName());
+ StoragePoolInfo poolInfo = answer.getPoolInfo();
+ Map<String, String> poolDetails = poolInfo.getDetails();
+ if (poolDetails == null) {
+ poolDetails = new HashMap<>();
Review comment:
Done
##########
File path:
plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
##########
@@ -913,9 +914,12 @@ private String cloneVMforVvols(VmwareContext context,
VmwareHypervisorHost hyper
if (volume.getVolumeType() == Volume.Type.DATADISK)
vmName = volume.getName();
if (!_fullCloneFlag) {
+ if (_diskProvisioningStrictness) {
+ throw new CloudRuntimeException("Unable to create linked
clones with strict disk provisioning enabled");
Review comment:
Fixed
##########
File path:
plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
##########
@@ -929,21 +933,24 @@ private String cloneVMforVvols(VmwareContext context,
VmwareHypervisorHost hyper
return vmdkFileBaseName;
}
- private String createVMFolderWithVMName(VmwareContext context,
VmwareHypervisorHost hyperHost, TemplateObjectTO template,
- VirtualMachineMO vmTemplate,
VolumeObjectTO volume, DatacenterMO dcMo, DatastoreMO dsMo,
- String searchExcludedFolders)
throws Exception {
+ private String createVMAndFolderWithVMName(VmwareContext context,
VmwareHypervisorHost hyperHost, TemplateObjectTO template,
+ VirtualMachineMO vmTemplate,
VolumeObjectTO volume, DatacenterMO dcMo, DatastoreMO dsMo,
+ String searchExcludedFolders)
throws Exception {
String vmdkName = volume.getName();
try {
ManagedObjectReference morDatastore = dsMo.getMor();
ManagedObjectReference morPool =
hyperHost.getHyperHostOwnerResourcePool();
ManagedObjectReference morCluster =
hyperHost.getHyperHostCluster();
- if (template.getSize() != null){
+ if (template.getSize() != null) {
_fullCloneFlag = volume.getSize() > template.getSize() ? true
: _fullCloneFlag;
}
if (!_fullCloneFlag) {
+ if (_diskProvisioningStrictness) {
+ throw new CloudRuntimeException("Unable to create linked
clones with strict disk provisioning enabled");
Review comment:
Fixed
##########
File path:
plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
##########
@@ -997,9 +1004,12 @@ private void createLinkedOrFullClone(TemplateObjectTO
template, VolumeObjectTO v
_fullCloneFlag = volume.getSize() > template.getSize() ||
_fullCloneFlag;
}
if (!_fullCloneFlag) {
+ if (_diskProvisioningStrictness) {
+ throw new CloudRuntimeException("Unable to create linked
clones with strict disk provisioning enabled");
Review comment:
fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]