|
48 | 48 | import javax.naming.ConfigurationException; |
49 | 49 | import javax.xml.datatype.XMLGregorianCalendar; |
50 | 50 |
|
| 51 | +import com.cloud.capacity.CapacityManager; |
51 | 52 | import com.cloud.hypervisor.vmware.mo.HostDatastoreBrowserMO; |
52 | 53 | import com.vmware.vim25.FileInfo; |
53 | 54 | import com.vmware.vim25.FileQueryFlags; |
@@ -2277,15 +2278,15 @@ protected StartAnswer execute(StartCommand cmd) { |
2277 | 2278 | // attach ISO (for patching of system VM) |
2278 | 2279 | Pair<String, Long> secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId)); |
2279 | 2280 | String secStoreUrl = secStoreUrlAndId.first(); |
2280 | | - Long secStoreId = secStoreUrlAndId.second(); |
2281 | 2281 | if (secStoreUrl == null) { |
2282 | | - String msg = "secondary storage for dc " + _dcId + " is not ready yet?"; |
| 2282 | + String msg = String.format("NFS secondary or cache storage of dc %s either doesn't have enough capacity (has reached %d%% usage threshold) or not ready yet, or non-NFS secondary storage is used", |
| 2283 | + _dcId, Math.round(CapacityManager.SecondaryStorageCapacityThreshold.value() * 100)); |
2283 | 2284 | throw new Exception(msg); |
2284 | 2285 | } |
2285 | 2286 |
|
2286 | 2287 | ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl); |
2287 | 2288 | if (morSecDs == null) { |
2288 | | - String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl; |
| 2289 | + String msg = "Failed to prepare secondary storage on host, NFS secondary or cache store url: " + secStoreUrl + " in dc "+ _dcId; |
2289 | 2290 | throw new Exception(msg); |
2290 | 2291 | } |
2291 | 2292 | DatastoreMO secDsMo = new DatastoreMO(hyperHost.getContext(), morSecDs); |
@@ -4613,15 +4614,15 @@ protected Answer execute(PrepareForMigrationCommand cmd) { |
4613 | 4614 | List<Pair<String, Long>> secStoreUrlAndIdList = mgr.getSecondaryStorageStoresUrlAndIdList(Long.parseLong(_dcId)); |
4614 | 4615 | for (Pair<String, Long> secStoreUrlAndId : secStoreUrlAndIdList) { |
4615 | 4616 | String secStoreUrl = secStoreUrlAndId.first(); |
4616 | | - Long secStoreId = secStoreUrlAndId.second(); |
4617 | 4617 | if (secStoreUrl == null) { |
4618 | | - String msg = String.format("Secondary storage for dc %s is not ready yet?", _dcId); |
| 4618 | + String msg = String.format("NFS secondary or cache storage of dc %s either doesn't have enough capacity (has reached %d%% usage threshold) or not ready yet, or non-NFS secondary storage is used", |
| 4619 | + _dcId, Math.round(CapacityManager.SecondaryStorageCapacityThreshold.value() * 100)); |
4619 | 4620 | throw new Exception(msg); |
4620 | 4621 | } |
4621 | 4622 |
|
4622 | 4623 | ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl); |
4623 | 4624 | if (morSecDs == null) { |
4624 | | - String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl; |
| 4625 | + String msg = "Failed to prepare secondary storage on host, NFS secondary or cache store url: " + secStoreUrl + " in dc "+ _dcId; |
4625 | 4626 | throw new Exception(msg); |
4626 | 4627 | } |
4627 | 4628 | } |
@@ -7343,14 +7344,14 @@ private List<VolumeObjectTO> relocateVirtualMachine(final VmwareHypervisorHost h |
7343 | 7344 | VmwareManager mgr = targetHyperHost.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); |
7344 | 7345 | Pair<String, Long> secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId)); |
7345 | 7346 | String secStoreUrl = secStoreUrlAndId.first(); |
7346 | | - Long secStoreId = secStoreUrlAndId.second(); |
7347 | 7347 | if (secStoreUrl == null) { |
7348 | | - String msg = "secondary storage for dc " + _dcId + " is not ready yet?"; |
| 7348 | + String msg = String.format("NFS secondary or cache storage of dc %s either doesn't have enough capacity (has reached %d%% usage threshold) or not ready yet, or non-NFS secondary storage is used", |
| 7349 | + _dcId, Math.round(CapacityManager.SecondaryStorageCapacityThreshold.value() * 100)); |
7349 | 7350 | throw new Exception(msg); |
7350 | 7351 | } |
7351 | 7352 | ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnSpecificHost(secStoreUrl, targetHyperHost); |
7352 | 7353 | if (morSecDs == null) { |
7353 | | - throw new Exception(String.format("Failed to prepare secondary storage on host, secondary store url: %s", secStoreUrl)); |
| 7354 | + throw new Exception(String.format("Failed to prepare secondary storage on host, NFS secondary or cache store url: %s in dc %s", secStoreUrl, _dcId)); |
7354 | 7355 | } |
7355 | 7356 | } |
7356 | 7357 |
|
|
0 commit comments