Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Backup and Recovery for Shared Filesystems #9676

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
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;
Expand Down Expand Up @@ -296,13 +294,6 @@ public boolean assignVMToBackupOffering(Long vmId, Long offeringId) {
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);
Expand Down Expand Up @@ -431,12 +422,6 @@ public BackupSchedule configureBackupSchedule(CreateBackupScheduleCmd cmd) {
}

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);

Expand Down Expand Up @@ -504,13 +489,6 @@ public boolean createBackup(final Long vmId) {
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");
}
Expand Down Expand Up @@ -784,12 +762,6 @@ public boolean restoreBackupVolumeAndAttachToVM(final String backedUpVolumeUuid,
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()) {
Expand Down
8 changes: 4 additions & 4 deletions ui/src/config/section/compute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand All @@ -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: {
Expand All @@ -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 }
Expand Down
Loading