Merge branch '4.19' into 4.20

This commit is contained in:
Daan Hoogland 2025-02-27 17:10:54 +01:00
commit 88916dcf2b
8 changed files with 54 additions and 14 deletions

View File

@ -24,6 +24,7 @@ public class MigrationOptions implements Serializable {
private String srcPoolUuid; private String srcPoolUuid;
private Storage.StoragePoolType srcPoolType; private Storage.StoragePoolType srcPoolType;
private Long srcPoolClusterId;
private Type type; private Type type;
private ScopeType scopeType; private ScopeType scopeType;
private String srcBackingFilePath; private String srcBackingFilePath;
@ -38,21 +39,23 @@ public class MigrationOptions implements Serializable {
public MigrationOptions() { public MigrationOptions() {
} }
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcBackingFilePath, boolean copySrcTemplate, ScopeType scopeType) { public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcBackingFilePath, boolean copySrcTemplate, ScopeType scopeType, Long srcPoolClusterId) {
this.srcPoolUuid = srcPoolUuid; this.srcPoolUuid = srcPoolUuid;
this.srcPoolType = srcPoolType; this.srcPoolType = srcPoolType;
this.type = Type.LinkedClone; this.type = Type.LinkedClone;
this.scopeType = scopeType; this.scopeType = scopeType;
this.srcBackingFilePath = srcBackingFilePath; this.srcBackingFilePath = srcBackingFilePath;
this.copySrcTemplate = copySrcTemplate; this.copySrcTemplate = copySrcTemplate;
this.srcPoolClusterId = srcPoolClusterId;
} }
public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcVolumeUuid, ScopeType scopeType) { public MigrationOptions(String srcPoolUuid, Storage.StoragePoolType srcPoolType, String srcVolumeUuid, ScopeType scopeType, Long srcPoolClusterId) {
this.srcPoolUuid = srcPoolUuid; this.srcPoolUuid = srcPoolUuid;
this.srcPoolType = srcPoolType; this.srcPoolType = srcPoolType;
this.type = Type.FullClone; this.type = Type.FullClone;
this.scopeType = scopeType; this.scopeType = scopeType;
this.srcVolumeUuid = srcVolumeUuid; this.srcVolumeUuid = srcVolumeUuid;
this.srcPoolClusterId = srcPoolClusterId;
} }
public String getSrcPoolUuid() { public String getSrcPoolUuid() {
@ -63,6 +66,10 @@ public class MigrationOptions implements Serializable {
return srcPoolType; return srcPoolType;
} }
public Long getSrcPoolClusterId() {
return srcPoolClusterId;
}
public ScopeType getScopeType() { return scopeType; } public ScopeType getScopeType() { return scopeType; }
public String getSrcBackingFilePath() { public String getSrcBackingFilePath() {

View File

@ -215,7 +215,7 @@ public class KvmNonManagedStorageDataMotionStrategy extends StorageSystemDataMot
} }
VMTemplateStoragePoolVO sourceVolumeTemplateStoragePoolVO = vmTemplatePoolDao.findByPoolTemplate(destStoragePool.getId(), srcVolumeInfo.getTemplateId(), null); VMTemplateStoragePoolVO sourceVolumeTemplateStoragePoolVO = vmTemplatePoolDao.findByPoolTemplate(destStoragePool.getId(), srcVolumeInfo.getTemplateId(), null);
if (sourceVolumeTemplateStoragePoolVO == null && (isStoragePoolTypeInList(destStoragePool.getPoolType(), StoragePoolType.Filesystem, StoragePoolType.SharedMountPoint))) { if (sourceVolumeTemplateStoragePoolVO == null && (isStoragePoolTypeInList(destStoragePool.getPoolType(), StoragePoolType.NetworkFilesystem, StoragePoolType.Filesystem, StoragePoolType.SharedMountPoint))) {
DataStore sourceTemplateDataStore = dataStoreManagerImpl.getRandomImageStore(srcVolumeInfo.getDataCenterId()); DataStore sourceTemplateDataStore = dataStoreManagerImpl.getRandomImageStore(srcVolumeInfo.getDataCenterId());
if (sourceTemplateDataStore != null) { if (sourceTemplateDataStore != null) {
TemplateInfo sourceTemplateInfo = templateDataFactory.getTemplate(srcVolumeInfo.getTemplateId(), sourceTemplateDataStore); TemplateInfo sourceTemplateInfo = templateDataFactory.getTemplate(srcVolumeInfo.getTemplateId(), sourceTemplateDataStore);

View File

@ -1949,18 +1949,26 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
/** /**
* Return expected MigrationOptions for a linked clone volume live storage migration * Return expected MigrationOptions for a linked clone volume live storage migration
*/ */
protected MigrationOptions createLinkedCloneMigrationOptions(VolumeInfo srcVolumeInfo, VolumeInfo destVolumeInfo, String srcVolumeBackingFile, String srcPoolUuid, Storage.StoragePoolType srcPoolType) { protected MigrationOptions createLinkedCloneMigrationOptions(VolumeInfo srcVolumeInfo, VolumeInfo destVolumeInfo, String srcVolumeBackingFile, StoragePoolVO srcPool) {
String srcPoolUuid = srcPool.getUuid();
Storage.StoragePoolType srcPoolType = srcPool.getPoolType();
Long srcPoolClusterId = srcPool.getClusterId();
VMTemplateStoragePoolVO ref = templatePoolDao.findByPoolTemplate(destVolumeInfo.getPoolId(), srcVolumeInfo.getTemplateId(), null); VMTemplateStoragePoolVO ref = templatePoolDao.findByPoolTemplate(destVolumeInfo.getPoolId(), srcVolumeInfo.getTemplateId(), null);
boolean updateBackingFileReference = ref == null; boolean updateBackingFileReference = ref == null;
String backingFile = !updateBackingFileReference ? ref.getInstallPath() : srcVolumeBackingFile; String backingFile = !updateBackingFileReference ? ref.getInstallPath() : srcVolumeBackingFile;
return new MigrationOptions(srcPoolUuid, srcPoolType, backingFile, updateBackingFileReference, srcVolumeInfo.getDataStore().getScope().getScopeType()); ScopeType scopeType = srcVolumeInfo.getDataStore().getScope().getScopeType();
return new MigrationOptions(srcPoolUuid, srcPoolType, backingFile, updateBackingFileReference, scopeType, srcPoolClusterId);
} }
/** /**
* Return expected MigrationOptions for a full clone volume live storage migration * Return expected MigrationOptions for a full clone volume live storage migration
*/ */
protected MigrationOptions createFullCloneMigrationOptions(VolumeInfo srcVolumeInfo, VirtualMachineTO vmTO, Host srcHost, String srcPoolUuid, Storage.StoragePoolType srcPoolType) { protected MigrationOptions createFullCloneMigrationOptions(VolumeInfo srcVolumeInfo, VirtualMachineTO vmTO, Host srcHost, StoragePoolVO srcPool) {
return new MigrationOptions(srcPoolUuid, srcPoolType, srcVolumeInfo.getPath(), srcVolumeInfo.getDataStore().getScope().getScopeType()); String srcPoolUuid = srcPool.getUuid();
Storage.StoragePoolType srcPoolType = srcPool.getPoolType();
Long srcPoolClusterId = srcPool.getClusterId();
ScopeType scopeType = srcVolumeInfo.getDataStore().getScope().getScopeType();
return new MigrationOptions(srcPoolUuid, srcPoolType, srcVolumeInfo.getPath(), scopeType, srcPoolClusterId);
} }
/** /**
@ -1983,9 +1991,9 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
MigrationOptions migrationOptions; MigrationOptions migrationOptions;
if (MigrationOptions.Type.LinkedClone.equals(migrationType)) { if (MigrationOptions.Type.LinkedClone.equals(migrationType)) {
migrationOptions = createLinkedCloneMigrationOptions(srcVolumeInfo, destVolumeInfo, srcVolumeBackingFile, srcPoolUuid, srcPoolType); migrationOptions = createLinkedCloneMigrationOptions(srcVolumeInfo, destVolumeInfo, srcVolumeBackingFile, srcPool);
} else { } else {
migrationOptions = createFullCloneMigrationOptions(srcVolumeInfo, vmTO, srcHost, srcPoolUuid, srcPoolType); migrationOptions = createFullCloneMigrationOptions(srcVolumeInfo, vmTO, srcHost, srcPool);
} }
migrationOptions.setTimeout(StorageManager.KvmStorageOnlineMigrationWait.value()); migrationOptions.setTimeout(StorageManager.KvmStorageOnlineMigrationWait.value());
destVolumeInfo.setMigrationOptions(migrationOptions); destVolumeInfo.setMigrationOptions(migrationOptions);

View File

@ -639,6 +639,10 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
return libvirtUtilitiesHelper; return libvirtUtilitiesHelper;
} }
public String getClusterId() {
return clusterId;
}
public CPUStat getCPUStat() { public CPUStat getCPUStat() {
return cpuStat; return cpuStat;
} }

View File

@ -2660,6 +2660,12 @@ public class KVMStorageProcessor implements StorageProcessor {
return localPool; return localPool;
} }
if (migrationOptions.getScopeType().equals(ScopeType.CLUSTER)
&& migrationOptions.getSrcPoolClusterId() != null
&& !migrationOptions.getSrcPoolClusterId().toString().equals(resource.getClusterId())) {
return localPool;
}
return storagePoolMgr.getStoragePool(migrationOptions.getSrcPoolType(), migrationOptions.getSrcPoolUuid()); return storagePoolMgr.getStoragePool(migrationOptions.getSrcPoolType(), migrationOptions.getSrcPoolUuid());
} }
} }

View File

@ -1208,6 +1208,11 @@ export default {
if (item.value) { if (item.value) {
query[item.param] = this.resource[item.value] query[item.param] = this.resource[item.value]
} else { } else {
if (item.name === 'template') {
query.templatefilter = 'self'
query.filter = 'self'
}
if (item.param === 'account') { if (item.param === 'account') {
query[item.param] = this.resource.name query[item.param] = this.resource.name
query.domainid = this.resource.domainid query.domainid = this.resource.domainid

View File

@ -160,6 +160,10 @@
   
<a-tag>static-nat</a-tag> <a-tag>static-nat</a-tag>
</span> </span>
<span v-if="record.issystem">
&nbsp;
<a-tag>system</a-tag>
</span>
</template> </template>
<template v-if="column.key === 'ip6address'" href="javascript:;"> <template v-if="column.key === 'ip6address'" href="javascript:;">
<span>{{ ipV6Address(text, record) }}</span> <span>{{ ipV6Address(text, record) }}</span>
@ -412,8 +416,8 @@
<status :text="record.enabled ? record.enabled.toString() : 'false'" /> <status :text="record.enabled ? record.enabled.toString() : 'false'" />
{{ record.enabled ? 'Enabled' : 'Disabled' }} {{ record.enabled ? 'Enabled' : 'Disabled' }}
</template> </template>
<template v-if="['created', 'sent', 'removed', 'effectiveDate', 'endDate'].includes(column.key) || (['startdate'].includes(column.key) && ['webhook'].includes($route.path.split('/')[1])) || (column.key === 'allocated' && ['asnumbers', 'publicip', 'ipv4subnets'].includes($route.meta.name) && text)"> <template v-if="['created', 'sent', 'removed', 'effectiveDate', 'endDate', 'allocated'].includes(column.key) || (['startdate'].includes(column.key) && ['webhook'].includes($route.path.split('/')[1])) || (column.key === 'allocated' && ['asnumbers', 'publicip', 'ipv4subnets'].includes($route.meta.name) && text)">
{{ $toLocaleDate(text) }} {{ text && $toLocaleDate(text) }}
</template> </template>
<template v-if="['startdate', 'enddate'].includes(column.key) && ['vm', 'vnfapp'].includes($route.path.split('/')[1])"> <template v-if="['startdate', 'enddate'].includes(column.key) && ['vm', 'vnfapp'].includes($route.path.split('/')[1])">
{{ getDateAtTimeZone(text, record.timezone) }} {{ getDateAtTimeZone(text, record.timezone) }}

View File

@ -840,10 +840,13 @@ export default {
message: 'message.action.release.ip', message: 'message.action.release.ip',
docHelp: 'adminguide/networking_and_traffic.html#releasing-an-ip-address-alloted-to-a-vpc', docHelp: 'adminguide/networking_and_traffic.html#releasing-an-ip-address-alloted-to-a-vpc',
dataView: true, dataView: true,
show: (record) => { return record.state === 'Allocated' && !record.issourcenat }, show: (record) => { return record.state === 'Allocated' && !record.issourcenat && !record.issystem },
groupAction: true, groupAction: true,
popup: true, popup: true,
groupMap: (selection) => { return selection.map(x => { return { id: x } }) } groupMap: (selection) => { return selection.map(x => { return { id: x } }) },
groupShow: (selectedIps) => {
return selectedIps.every((ip) => ip.state === 'Allocated' && !ip.issourcenat && !ip.issystem)
}
}, },
{ {
api: 'reserveIpAddress', api: 'reserveIpAddress',
@ -863,7 +866,10 @@ export default {
show: (record) => { return record.state === 'Reserved' }, show: (record) => { return record.state === 'Reserved' },
groupAction: true, groupAction: true,
popup: true, popup: true,
groupMap: (selection) => { return selection.map(x => { return { id: x } }) } groupMap: (selection) => { return selection.map(x => { return { id: x } }) },
groupShow: (selectedIps) => {
return selectedIps.every((ip) => ip.state === 'Reserved')
}
} }
] ]
}, },