mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Enable Backup and Recovery for Shared Filesystems (#9676)
This commit is contained in:
parent
1d37ff23ac
commit
7d95952bc1
@ -31,8 +31,6 @@ import java.util.stream.Collectors;
|
||||
import com.amazonaws.util.CollectionUtils;
|
||||
import com.cloud.storage.VolumeApiService;
|
||||
import com.cloud.utils.fsm.NoTransitionException;
|
||||
import com.cloud.vm.UserVmManager;
|
||||
import com.cloud.vm.UserVmVO;
|
||||
import com.cloud.vm.VirtualMachineManager;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
@ -296,13 +294,6 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager {
|
||||
throw new CloudRuntimeException("VM is not in running or stopped state");
|
||||
}
|
||||
|
||||
if (vm.getType().equals(VirtualMachine.Type.User)) {
|
||||
UserVmVO userVm = userVmDao.findById(vmId);
|
||||
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
|
||||
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
|
||||
}
|
||||
}
|
||||
|
||||
validateForZone(vm.getDataCenterId());
|
||||
|
||||
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
|
||||
@ -431,12 +422,6 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager {
|
||||
}
|
||||
|
||||
final VMInstanceVO vm = findVmById(vmId);
|
||||
if (vm.getType().equals(VirtualMachine.Type.User)) {
|
||||
UserVmVO userVm = userVmDao.findById(vmId);
|
||||
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
|
||||
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
|
||||
}
|
||||
}
|
||||
validateForZone(vm.getDataCenterId());
|
||||
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
|
||||
|
||||
@ -504,13 +489,6 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager {
|
||||
validateForZone(vm.getDataCenterId());
|
||||
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
|
||||
|
||||
if (vm.getType().equals(VirtualMachine.Type.User)) {
|
||||
UserVmVO userVm = userVmDao.findById(vmId);
|
||||
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
|
||||
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
|
||||
}
|
||||
}
|
||||
|
||||
if (vm.getBackupOfferingId() == null) {
|
||||
throw new CloudRuntimeException("VM has not backup offering configured, cannot create backup before assigning it to a backup offering");
|
||||
}
|
||||
@ -784,12 +762,6 @@ public class BackupManagerImpl extends ManagerBase implements BackupManager {
|
||||
validateForZone(backup.getZoneId());
|
||||
|
||||
final VMInstanceVO vm = findVmById(vmId);
|
||||
if (vm.getType().equals(VirtualMachine.Type.User)) {
|
||||
UserVmVO userVm = userVmDao.findById(vmId);
|
||||
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
|
||||
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
|
||||
}
|
||||
}
|
||||
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
|
||||
|
||||
if (vm.getBackupOfferingId() != null && !BackupEnableAttachDetachVolumes.value()) {
|
||||
|
||||
@ -222,7 +222,7 @@ export default {
|
||||
docHelp: 'adminguide/virtual_machines.html#backup-offerings',
|
||||
dataView: true,
|
||||
args: ['virtualmachineid', 'backupofferingid'],
|
||||
show: (record) => { return !record.backupofferingid && record.vmtype !== 'sharedfsvm' },
|
||||
show: (record) => { return !record.backupofferingid },
|
||||
mapping: {
|
||||
virtualmachineid: {
|
||||
value: (record, params) => { return record.id }
|
||||
@ -237,7 +237,7 @@ export default {
|
||||
docHelp: 'adminguide/virtual_machines.html#creating-vm-backups',
|
||||
dataView: true,
|
||||
args: ['virtualmachineid'],
|
||||
show: (record) => { return record.backupofferingid && record.vmtype !== 'sharedfsvm' },
|
||||
show: (record) => { return record.backupofferingid },
|
||||
mapping: {
|
||||
virtualmachineid: {
|
||||
value: (record, params) => { return record.id }
|
||||
@ -251,7 +251,7 @@ export default {
|
||||
docHelp: 'adminguide/virtual_machines.html#creating-vm-backups',
|
||||
dataView: true,
|
||||
popup: true,
|
||||
show: (record) => { return record.backupofferingid && record.vmtype !== 'sharedfsvm' },
|
||||
show: (record) => { return record.backupofferingid },
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/views/compute/BackupScheduleWizard.vue'))),
|
||||
mapping: {
|
||||
virtualmachineid: {
|
||||
@ -270,7 +270,7 @@ export default {
|
||||
docHelp: 'adminguide/virtual_machines.html#restoring-vm-backups',
|
||||
dataView: true,
|
||||
args: ['virtualmachineid', 'forced'],
|
||||
show: (record) => { return record.backupofferingid && record.vmtype !== 'sharedfsvm' },
|
||||
show: (record) => { return record.backupofferingid },
|
||||
mapping: {
|
||||
virtualmachineid: {
|
||||
value: (record, params) => { return record.id }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user