Merge remote-tracking branch 'origin/4.18'

This commit is contained in:
Rohit Yadav 2023-10-11 21:00:06 +05:30
commit 8a34afa8ab
4 changed files with 7 additions and 20 deletions

View File

@ -59,7 +59,6 @@ import com.cloud.storage.DataStoreRole;
import com.cloud.storage.GuestOSVO; import com.cloud.storage.GuestOSVO;
import com.cloud.storage.Snapshot; import com.cloud.storage.Snapshot;
import com.cloud.storage.SnapshotVO; import com.cloud.storage.SnapshotVO;
import com.cloud.storage.Storage;
import com.cloud.storage.VolumeApiService; import com.cloud.storage.VolumeApiService;
import com.cloud.storage.VolumeVO; import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.SnapshotDao; import com.cloud.storage.dao.SnapshotDao;
@ -360,10 +359,6 @@ public class StorageVMSnapshotStrategy extends DefaultVMSnapshotStrategy {
@Override @Override
public StrategyPriority canHandle(Long vmId, Long rootPoolId, boolean snapshotMemory) { public StrategyPriority canHandle(Long vmId, Long rootPoolId, boolean snapshotMemory) {
//This check could be removed when PR #5297 is merged
if (vmHasNFSOrLocalVolumes(vmId)) {
return StrategyPriority.CANT_HANDLE;
}
if (SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) { if (SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
UserVmVO vm = userVmDao.findById(vmId); UserVmVO vm = userVmDao.findById(vmId);
if (vm.getState() == VirtualMachine.State.Running) { if (vm.getState() == VirtualMachine.State.Running) {
@ -465,17 +460,4 @@ public class StorageVMSnapshotStrategy extends DefaultVMSnapshotStrategy {
payload.setQuiescevm(false); payload.setQuiescevm(false);
return payload; return payload;
} }
private boolean vmHasNFSOrLocalVolumes(long vmId) {
List<VolumeObjectTO> volumeTOs = vmSnapshotHelper.getVolumeTOList(vmId);
for (VolumeObjectTO volumeTO : volumeTOs) {
Long poolId = volumeTO.getPoolId();
Storage.StoragePoolType poolType = vmSnapshotHelper.getStoragePoolType(poolId);
if (poolType == Storage.StoragePoolType.NetworkFilesystem || poolType == Storage.StoragePoolType.Filesystem) {
return true;
}
}
return false;
}
} }

View File

@ -1299,6 +1299,7 @@
"label.move.to.bottom": "Move to bottom", "label.move.to.bottom": "Move to bottom",
"label.move.to.top": "Move to top", "label.move.to.top": "Move to top",
"label.move.up.row": "Move up one row", "label.move.up.row": "Move up one row",
"label.my.isos": "My ISOs",
"label.my.templates": "My templates", "label.my.templates": "My templates",
"label.na": "N/A", "label.na": "N/A",
"label.name": "Name", "label.name": "Name",

View File

@ -56,6 +56,10 @@ export default {
name: 'TemplateIsoSelection', name: 'TemplateIsoSelection',
components: { TemplateIsoRadioGroup }, components: { TemplateIsoRadioGroup },
props: { props: {
selected: {
type: String,
default: null
},
items: { items: {
type: Object, type: Object,
default: () => {} default: () => {}
@ -85,7 +89,7 @@ export default {
name: 'label.community' name: 'label.community'
}, { }, {
id: 'selfexecutable', id: 'selfexecutable',
name: 'label.my.templates' name: this.selected === 'isoid' ? 'label.my.isos' : 'label.my.templates'
}, { }, {
id: 'sharedexecutable', id: 'sharedexecutable',
name: 'label.sharedexecutable' name: 'label.sharedexecutable'

View File

@ -413,7 +413,7 @@ export default {
(newValue, oldValue) => { (newValue, oldValue) => {
if (newValue && newValue.id && (!oldValue || newValue.id !== oldValue.id)) { if (newValue && newValue.id && (!oldValue || newValue.id !== oldValue.id)) {
this.fetchData() this.fetchData()
} else if (store.getters.userInfo.roletype !== 'Admin') { } else if (store.getters.userInfo.roletype !== 'Admin' && !store.getters.logoutFlag) {
this.fetchData() this.fetchData()
} }
} }