Merge remote-tracking branch 'apache/4.20'

This commit is contained in:
Wei Zhou 2025-10-08 15:40:33 +02:00
commit 6089c161a6
No known key found for this signature in database
GPG Key ID: 1503DFE7C8226103
13 changed files with 61 additions and 22 deletions

View File

@ -302,6 +302,8 @@ public interface StorageManager extends StorageService {
Answer sendToPool(StoragePool pool, long[] hostIdsToTryFirst, Command cmd) throws StorageUnavailableException;
void updateStoragePoolHostVOAndBytes(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer);
CapacityVO getSecondaryStorageUsedStats(Long hostId, Long zoneId);
CapacityVO getStoragePoolUsedStats(Long poolId, Long clusterId, Long podId, Long zoneId);

View File

@ -476,8 +476,8 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl extends BasePrimaryDataStor
@Override
public boolean cancelMaintain(DataStore store) {
storagePoolAutmation.cancelMaintain(store);
dataStoreHelper.cancelMaintain(store);
storagePoolAutmation.cancelMaintain(store);
return true;
}

View File

@ -3072,7 +3072,8 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
}
private void updateStoragePoolHostVOAndBytes(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer) {
@Override
public void updateStoragePoolHostVOAndBytes(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer) {
StoragePoolHostVO poolHost = _storagePoolHostDao.findByPoolHost(pool.getId(), hostId);
if (poolHost == null) {
poolHost = new StoragePoolHostVO(pool.getId(), hostId, mspAnswer.getPoolInfo().getLocalPath().replaceAll("//", "/"));
@ -3082,8 +3083,10 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
}
StoragePoolVO poolVO = _storagePoolDao.findById(pool.getId());
poolVO.setUsedBytes(mspAnswer.getPoolInfo().getCapacityBytes() - mspAnswer.getPoolInfo().getAvailableBytes());
poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());
if (!Storage.StoragePoolType.StorPool.equals(poolVO.getPoolType())) {
poolVO.setUsedBytes(mspAnswer.getPoolInfo().getCapacityBytes() - mspAnswer.getPoolInfo().getAvailableBytes());
poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());
}
_storagePoolDao.update(pool.getId(), poolVO);
}

View File

@ -363,6 +363,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
if (logger.isDebugEnabled()) {
logger.debug("ModifyStoragePool add succeeded");
}
storageManager.updateStoragePoolHostVOAndBytes(pool, host.getId(), (ModifyStoragePoolAnswer) answer);
if (pool.getPoolType() == Storage.StoragePoolType.DatastoreCluster) {
logger.debug("Started synchronising datastore cluster storage pool {} with vCenter", pool);
storageManager.syncDatastoreClusterStoragePool(pool.getId(), ((ModifyStoragePoolAnswer) answer).getDatastoreClusterChildren(), host.getId());

View File

@ -32,8 +32,8 @@
"format": "qcow2",
"headless": true,
"http_directory": "http",
"iso_checksum": "sha512:892cf1185a214d16ff62a18c6b89cdcd58719647c99916f6214bfca6f9915275d727b666c0b8fbf022c425ef18647e9759974abf7fc440431c39b50c296a98d3",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso",
"iso_checksum": "sha512:55ab206cd8b0da2898767c3eb6ab5ebef101e3925ec91b3b5f0a286136195b7072588f6ac2d059c545c6938978704ae78cd18d7d9d2a86a7380e46ce27ee4e7b",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.12.0/arm64/iso-cd/debian-12.12.0-arm64-netinst.iso",
"net_device": "virtio-net",
"output_directory": "../dist",
"qemu_binary": "qemu-system-aarch64",

View File

@ -31,8 +31,8 @@
"format": "qcow2",
"headless": true,
"http_directory": "http",
"iso_checksum": "sha512:892cf1185a214d16ff62a18c6b89cdcd58719647c99916f6214bfca6f9915275d727b666c0b8fbf022c425ef18647e9759974abf7fc440431c39b50c296a98d3",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.11.0/arm64/iso-cd/debian-12.11.0-arm64-netinst.iso",
"iso_checksum": "sha512:55ab206cd8b0da2898767c3eb6ab5ebef101e3925ec91b3b5f0a286136195b7072588f6ac2d059c545c6938978704ae78cd18d7d9d2a86a7380e46ce27ee4e7b",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.12.0/arm64/iso-cd/debian-12.12.0-arm64-netinst.iso",
"net_device": "virtio-net",
"output_directory": "../dist",
"qemu_binary": "qemu-system-aarch64",

View File

@ -27,8 +27,8 @@
"format": "qcow2",
"headless": true,
"http_directory": "http",
"iso_checksum": "sha512:0921d8b297c63ac458d8a06f87cd4c353f751eb5fe30fd0d839ca09c0833d1d9934b02ee14bbd0c0ec4f8917dde793957801ae1af3c8122cdf28dde8f3c3e0da",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.11.0/amd64/iso-cd/debian-12.11.0-amd64-netinst.iso",
"iso_checksum": "sha512:c93055182057dd19a334260671c7e10880541b7721ad9c8df87be47e0a11d5bbf85018350ff224ff6a5f6a68320b07e95d539cef9dc020c93966bfaa86d4b2ce",
"iso_url": "https://cdimage.debian.org/mirror/cdimage/archive/12.12.0/amd64/iso-cd/debian-12.12.0-amd64-netinst.iso",
"net_device": "virtio-net",
"output_directory": "../dist",
"qemuargs": [

View File

@ -104,6 +104,7 @@
"showUserCategoryForModernImageSelection": true,
"showAllCategoryForModernImageSelection": false,
"docHelpMappings": {},
"notifyLatestCSVersion": true,
"announcementBanner": {
"enabled": false,
"showIcon": false,

View File

@ -338,7 +338,6 @@ const user = {
const result = response.listusersresponse.user[0]
commit('SET_INFO', result)
commit('SET_NAME', result.firstname + ' ' + result.lastname)
store.dispatch('SetCsLatestVersion', result.rolename)
resolve(cachedApis)
}).catch(error => {
reject(error)
@ -588,6 +587,9 @@ const user = {
commit('SET_DOMAIN_STORE', domainStore)
},
SetCsLatestVersion ({ commit }, rolename) {
if (!vueProps.$config.notifyLatestCSVersion) {
return
}
const lastFetchTs = store.getters.latestVersion?.fetchedTs ? store.getters.latestVersion.fetchedTs : 0
if (rolename === 'Root Admin' && (+new Date() - lastFetchTs) > 24 * 60 * 60 * 1000) {
axios.get(

View File

@ -396,7 +396,7 @@ export default {
placeHolder: 'message.error.server',
required: true,
display: {
primaryStorageProtocol: ['nfs', 'iscsi', 'gluster', 'SMB', 'Linstor']
primaryStorageProtocol: ['nfs', 'iscsi', 'gluster', 'SMB', 'Linstor', 'datastorecluster', 'vmfs']
}
},
{

View File

@ -1569,10 +1569,10 @@ export default {
}
path += '/' + this.prefillContent.primaryStorageVmfsDatastore
if (protocol === 'vmfs') {
url = this.vmfsURL('dummy', path)
url = this.vmfsURL(server, path)
}
if (protocol === 'datastorecluster') {
url = this.datastoreclusterURL('dummy', path)
url = this.datastoreclusterURL(server, path)
}
} else if (protocol === 'iscsi') {
let iqn = this.prefillContent?.primaryStorageTargetIQN || ''

View File

@ -414,7 +414,7 @@ export default {
for (const index in net.traffics) {
if (this.hypervisor === 'VMware') {
delete this.physicalNetworks[idx].traffics[index].label
} else {
} else if (!net.traffics[index].label) {
this.physicalNetworks[idx].traffics[index].label = ''
}
const traffic = net.traffics[index]

View File

@ -28,6 +28,7 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.Callable;
@ -157,13 +158,7 @@ public class Script implements Callable<String> {
boolean obscureParam = false;
for (int i = 0; i < command.length; i++) {
String cmd = command[i];
if (StringUtils.isNotEmpty(cmd) && cmd.startsWith("vi://")) {
String[] tokens = cmd.split("@");
if (tokens.length >= 2) {
builder.append("vi://").append("******@").append(tokens[1]).append(" ");
} else {
builder.append("vi://").append("******").append(" ");
}
if (sanitizeViCmdParameter(cmd, builder) || sanitizeRbdFileFormatCmdParameter(cmd, builder)) {
continue;
}
if (obscureParam) {
@ -181,6 +176,41 @@ public class Script implements Callable<String> {
return builder.toString();
}
private boolean sanitizeViCmdParameter(String cmd, StringBuilder builder) {
if (StringUtils.isEmpty(cmd) || !cmd.startsWith("vi://")) {
return false;
}
String[] tokens = cmd.split("@");
if (tokens.length >= 2) {
builder.append("vi://").append("******@").append(tokens[1]).append(" ");
} else {
builder.append("vi://").append("******").append(" ");
}
return true;
}
private boolean sanitizeRbdFileFormatCmdParameter(String cmd, StringBuilder builder) {
if (StringUtils.isEmpty(cmd) || !cmd.startsWith("rbd:") || !cmd.contains("key=")) {
return false;
}
String[] tokens = cmd.split("key=");
if (tokens.length != 2) {
return false;
}
String tokenWithKey = tokens[1];
String[] options = tokenWithKey.split(":");
if (options.length > 1) {
String optionsAfterKey = String.join(":", Arrays.copyOfRange(options, 1, options.length));
builder.append(tokens[0]).append("key=").append("******").append(":").append(optionsAfterKey).append(" ");
} else {
builder.append(tokens[0]).append("key=").append("******").append(" ");
}
return true;
}
public long getTimeout() {
return _timeout;
}