|
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;
|
@@ -2279,15 +2280,15 @@ protected StartAnswer execute(StartCommand cmd) {
|
2279 | 2280 | // attach ISO (for patching of system VM)
|
2280 | 2281 | Pair<String, Long> secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId));
|
2281 | 2282 | String secStoreUrl = secStoreUrlAndId.first();
|
2282 |
| - Long secStoreId = secStoreUrlAndId.second(); |
2283 | 2283 | if (secStoreUrl == null) {
|
2284 |
| - String msg = "secondary storage for dc " + _dcId + " is not ready yet?"; |
| 2284 | + 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", |
| 2285 | + _dcId, Math.round(CapacityManager.SecondaryStorageCapacityThreshold.value() * 100)); |
2285 | 2286 | throw new Exception(msg);
|
2286 | 2287 | }
|
2287 | 2288 |
|
2288 | 2289 | ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost(secStoreUrl);
|
2289 | 2290 | if (morSecDs == null) {
|
2290 |
| - String msg = "Failed to prepare secondary storage on host, secondary store url: " + secStoreUrl; |
| 2291 | + String msg = "Failed to prepare secondary storage on host, NFS secondary or cache store url: " + secStoreUrl + " in dc "+ _dcId; |
2291 | 2292 | throw new Exception(msg);
|
2292 | 2293 | }
|
2293 | 2294 | 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 | }
|
@@ -7342,14 +7343,14 @@ private List<VolumeObjectTO> relocateVirtualMachine(final VmwareHypervisorHost h
|
7342 | 7343 | VmwareManager mgr = targetHyperHost.getContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
|
7343 | 7344 | Pair<String, Long> secStoreUrlAndId = mgr.getSecondaryStorageStoreUrlAndId(Long.parseLong(_dcId));
|
7344 | 7345 | String secStoreUrl = secStoreUrlAndId.first();
|
7345 |
| - Long secStoreId = secStoreUrlAndId.second(); |
7346 | 7346 | if (secStoreUrl == null) {
|
7347 |
| - String msg = "secondary storage for dc " + _dcId + " is not ready yet?"; |
| 7347 | + 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", |
| 7348 | + _dcId, Math.round(CapacityManager.SecondaryStorageCapacityThreshold.value() * 100)); |
7348 | 7349 | throw new Exception(msg);
|
7349 | 7350 | }
|
7350 | 7351 | ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnSpecificHost(secStoreUrl, targetHyperHost);
|
7351 | 7352 | if (morSecDs == null) {
|
7352 |
| - throw new Exception(String.format("Failed to prepare secondary storage on host, secondary store url: %s", secStoreUrl)); |
| 7353 | + throw new Exception(String.format("Failed to prepare secondary storage on host, NFS secondary or cache store url: %s in dc %s", secStoreUrl, _dcId)); |
7353 | 7354 | }
|
7354 | 7355 | }
|
7355 | 7356 |
|
|
0 commit comments