mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.15' into main
This commit is contained in:
commit
04738d7775
@ -1416,7 +1416,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||||||
if (!_snapshotMgr.canOperateOnVolume(volume)) {
|
if (!_snapshotMgr.canOperateOnVolume(volume)) {
|
||||||
throw new InvalidParameterValueException("There are snapshot operations in progress on the volume, unable to delete it");
|
throw new InvalidParameterValueException("There are snapshot operations in progress on the volume, unable to delete it");
|
||||||
}
|
}
|
||||||
if (volume.getInstanceId() != null && volume.getState() != Volume.State.Expunged) {
|
if (volume.getInstanceId() != null && _vmInstanceDao.findById(volume.getInstanceId()) != null && volume.getState() != Volume.State.Expunged) {
|
||||||
throw new InvalidParameterValueException("Please specify a volume that is not attached to any VM.");
|
throw new InvalidParameterValueException("Please specify a volume that is not attached to any VM.");
|
||||||
}
|
}
|
||||||
if (volume.getState() == Volume.State.UploadOp) {
|
if (volume.getState() == Volume.State.UploadOp) {
|
||||||
@ -1581,6 +1581,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
_volsDao.detachVolume(volume.getId());
|
||||||
stateTransitTo(volume, Volume.Event.RecoverRequested);
|
stateTransitTo(volume, Volume.Event.RecoverRequested);
|
||||||
} catch (NoTransitionException e) {
|
} catch (NoTransitionException e) {
|
||||||
s_logger.debug("Failed to recover volume" + volume.getId(), e);
|
s_logger.debug("Failed to recover volume" + volume.getId(), e);
|
||||||
|
|||||||
@ -340,8 +340,8 @@ public class DiagnosticsServiceImpl extends ManagerBase implements PluggableServ
|
|||||||
File dataDirectory = new File(dataDirectoryInSecondaryStore);
|
File dataDirectory = new File(dataDirectoryInSecondaryStore);
|
||||||
boolean existsInSecondaryStore = dataDirectory.exists() || dataDirectory.mkdir();
|
boolean existsInSecondaryStore = dataDirectory.exists() || dataDirectory.mkdir();
|
||||||
if (existsInSecondaryStore) {
|
if (existsInSecondaryStore) {
|
||||||
// scp from system VM to mounted sec storage directory
|
String homeDir = System.getProperty("user.home");
|
||||||
File permKey = new File("/var/cloudstack/management/.ssh/id_rsa");
|
File permKey = new File(homeDir + "/.ssh/id_rsa");
|
||||||
SshHelper.scpFrom(vmSshIp, 3922, "root", permKey, dataDirectoryInSecondaryStore, diagnosticsFile);
|
SshHelper.scpFrom(vmSshIp, 3922, "root", permKey, dataDirectoryInSecondaryStore, diagnosticsFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user