Skip to content

Commit 7d95952

Browse files
authored
Enable Backup and Recovery for Shared Filesystems (#9676)
1 parent 1d37ff2 commit 7d95952

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import com.amazonaws.util.CollectionUtils;
3232
import com.cloud.storage.VolumeApiService;
3333
import com.cloud.utils.fsm.NoTransitionException;
34-
import com.cloud.vm.UserVmManager;
35-
import com.cloud.vm.UserVmVO;
3634
import com.cloud.vm.VirtualMachineManager;
3735
import javax.inject.Inject;
3836
import javax.naming.ConfigurationException;
@@ -296,13 +294,6 @@ public boolean assignVMToBackupOffering(Long vmId, Long offeringId) {
296294
throw new CloudRuntimeException("VM is not in running or stopped state");
297295
}
298296

299-
if (vm.getType().equals(VirtualMachine.Type.User)) {
300-
UserVmVO userVm = userVmDao.findById(vmId);
301-
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
302-
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
303-
}
304-
}
305-
306297
validateForZone(vm.getDataCenterId());
307298

308299
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
@@ -431,12 +422,6 @@ public BackupSchedule configureBackupSchedule(CreateBackupScheduleCmd cmd) {
431422
}
432423

433424
final VMInstanceVO vm = findVmById(vmId);
434-
if (vm.getType().equals(VirtualMachine.Type.User)) {
435-
UserVmVO userVm = userVmDao.findById(vmId);
436-
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
437-
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
438-
}
439-
}
440425
validateForZone(vm.getDataCenterId());
441426
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
442427

@@ -504,13 +489,6 @@ public boolean createBackup(final Long vmId) {
504489
validateForZone(vm.getDataCenterId());
505490
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
506491

507-
if (vm.getType().equals(VirtualMachine.Type.User)) {
508-
UserVmVO userVm = userVmDao.findById(vmId);
509-
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
510-
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
511-
}
512-
}
513-
514492
if (vm.getBackupOfferingId() == null) {
515493
throw new CloudRuntimeException("VM has not backup offering configured, cannot create backup before assigning it to a backup offering");
516494
}
@@ -784,12 +762,6 @@ public boolean restoreBackupVolumeAndAttachToVM(final String backedUpVolumeUuid,
784762
validateForZone(backup.getZoneId());
785763

786764
final VMInstanceVO vm = findVmById(vmId);
787-
if (vm.getType().equals(VirtualMachine.Type.User)) {
788-
UserVmVO userVm = userVmDao.findById(vmId);
789-
if (userVm != null && UserVmManager.SHAREDFSVM.equals(userVm.getUserVmType())) {
790-
throw new InvalidParameterValueException("Operation not supported on Shared FileSystem Instance");
791-
}
792-
}
793765
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
794766

795767
if (vm.getBackupOfferingId() != null && !BackupEnableAttachDetachVolumes.value()) {

ui/src/config/section/compute.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export default {
222222
docHelp: 'adminguide/virtual_machines.html#backup-offerings',
223223
dataView: true,
224224
args: ['virtualmachineid', 'backupofferingid'],
225-
show: (record) => { return !record.backupofferingid && record.vmtype !== 'sharedfsvm' },
225+
show: (record) => { return !record.backupofferingid },
226226
mapping: {
227227
virtualmachineid: {
228228
value: (record, params) => { return record.id }
@@ -237,7 +237,7 @@ export default {
237237
docHelp: 'adminguide/virtual_machines.html#creating-vm-backups',
238238
dataView: true,
239239
args: ['virtualmachineid'],
240-
show: (record) => { return record.backupofferingid && record.vmtype !== 'sharedfsvm' },
240+
show: (record) => { return record.backupofferingid },
241241
mapping: {
242242
virtualmachineid: {
243243
value: (record, params) => { return record.id }
@@ -251,7 +251,7 @@ export default {
251251
docHelp: 'adminguide/virtual_machines.html#creating-vm-backups',
252252
dataView: true,
253253
popup: true,
254-
show: (record) => { return record.backupofferingid && record.vmtype !== 'sharedfsvm' },
254+
show: (record) => { return record.backupofferingid },
255255
component: shallowRef(defineAsyncComponent(() => import('@/views/compute/BackupScheduleWizard.vue'))),
256256
mapping: {
257257
virtualmachineid: {
@@ -270,7 +270,7 @@ export default {
270270
docHelp: 'adminguide/virtual_machines.html#restoring-vm-backups',
271271
dataView: true,
272272
args: ['virtualmachineid', 'forced'],
273-
show: (record) => { return record.backupofferingid && record.vmtype !== 'sharedfsvm' },
273+
show: (record) => { return record.backupofferingid },
274274
mapping: {
275275
virtualmachineid: {
276276
value: (record, params) => { return record.id }

0 commit comments

Comments
 (0)