Merge remote-tracking branch 'origin/4.15'

This commit is contained in:
Rohit Yadav 2021-04-21 13:07:44 +05:30
commit e107f9aa93
8 changed files with 42 additions and 16 deletions

2
debian/rules vendored
View File

@ -38,7 +38,7 @@ override_dh_auto_install:
mkdir $(DESTDIR)/$(SYSCONFDIR)/profile.d
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/plugins
install -D agent/target/cloud-agent-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/$(PACKAGE)-agent.jar
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D plugins/hypervisors/kvm/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/

View File

@ -24,7 +24,7 @@ import com.cloud.utils.component.PluggableService;
public interface CloudianConnector extends PluggableService {
ConfigKey<Boolean> CloudianConnectorEnabled = new ConfigKey<>("Advanced", Boolean.class, "cloudian.connector.enabled", "false",
"If set to true, this enables the Cloudian Connector for CloudStack.", true);
"If set to true, this enables the Cloudian Connector for CloudStack.", false);
ConfigKey<String> CloudianAdminHost = new ConfigKey<>("Advanced", String.class, "cloudian.admin.host", "s3-admin.cloudian.com",
"The hostname of the Cloudian Admin server.", true);

View File

@ -1021,14 +1021,22 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
if (answer != null && answer.getResult()) {
storagePoolStats.put(pool.getId(), (StorageStats)answer);
boolean poolNeedsUpdating = false;
// Seems like we have dynamically updated the pool size since the prev. size and the current do not match
if (pool.getCapacityBytes() != ((StorageStats)answer).getCapacityBytes() ||
pool.getUsedBytes() != ((StorageStats)answer).getByteUsed()) {
if (_storagePoolStats.get(poolId) != null && _storagePoolStats.get(poolId).getCapacityBytes() != ((StorageStats)answer).getCapacityBytes()) {
if (((StorageStats)answer).getCapacityBytes() > 0) {
pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes());
if (pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) {
pool.setUsedBytes(((StorageStats) answer).getByteUsed());
pool.setUpdateTime(new Date());
poolNeedsUpdating = true;
} else {
s_logger.warn("Not setting capacity bytes, received " + ((StorageStats)answer).getCapacityBytes() + " capacity for pool ID " + poolId);
}
}
if (pool.getUsedBytes() != ((StorageStats)answer).getByteUsed() && pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) {
pool.setUsedBytes(((StorageStats) answer).getByteUsed());
poolNeedsUpdating = true;
}
if (poolNeedsUpdating) {
pool.setUpdateTime(new Date());
_storagePoolDao.update(pool.getId(), pool);
}
}

View File

@ -150,7 +150,7 @@ export default {
label: 'label.edit',
docHelp: 'adminguide/service_offerings.html#modifying-or-deleting-a-service-offering',
dataView: true,
args: ['name', 'displaytext']
args: ['name', 'displaytext', 'tags']
}, {
api: 'updateDiskOffering',
icon: 'lock',
@ -216,7 +216,7 @@ export default {
label: 'label.edit',
docHelp: 'adminguide/service_offerings.html#modifying-or-deleting-a-service-offering',
dataView: true,
args: ['name', 'displaytext', 'availability'],
args: ['name', 'displaytext', 'availability', 'tags'],
mapping: {
availability: {
options: ['Optional', 'Required']

View File

@ -284,7 +284,13 @@ export default {
label: 'label.action.create.volume',
dataView: true,
show: (record) => { return record.state === 'BackedUp' },
args: ['snapshotid', 'name'],
args: (record, store) => {
var fields = ['snapshotid', 'name']
if (record.volumetype === 'ROOT') {
fields.push('diskofferingid')
}
return fields
},
mapping: {
snapshotid: {
value: (record) => { return record.id }

View File

@ -983,13 +983,13 @@ export default {
continue
}
if (!input === undefined || input === null ||
(input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork'].includes(action.api))) {
(input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork', 'updateDiskOffering', 'updateNetworkOffering'].includes(action.api))) {
if (param.type === 'boolean') {
params[key] = false
}
break
}
if (!input) {
if (!input && input !== 0 && !['tags'].includes(key)) {
continue
}
if (action.mapping && key in action.mapping && action.mapping[key].options) {

View File

@ -106,7 +106,11 @@
@update-template-iso="updateFieldValue" />
<span>
{{ $t('label.override.rootdisk.size') }}
<a-switch :disabled="template.deployasis" @change="val => { this.showRootDiskSizeChanger = val }" style="margin-left: 10px;"/>
<a-switch
:checked="showRootDiskSizeChanger && rootDiskSizeFixed > 0"
:disabled="rootDiskSizeFixed > 0 || template.deployasis"
@change="val => { this.showRootDiskSizeChanger = val }"
style="margin-left: 10px;"/>
<div v-if="template.deployasis"> {{ this.$t('message.deployasis') }} </div>
</span>
<disk-size-selection
@ -185,7 +189,7 @@
</a-form-item>
<compute-offering-selection
:compute-items="options.serviceOfferings"
:selected-template="template"
:selected-template="template ? template : {}"
:row-count="rowCount.serviceOfferings"
:zoneId="zoneId"
:value="serviceOffering ? serviceOffering.id : ''"
@ -771,7 +775,8 @@ export default {
dataPreFill: {},
showDetails: false,
showRootDiskSizeChanger: false,
securitygroupids: []
securitygroupids: [],
rootDiskSizeFixed: 0
}
},
computed: {
@ -1422,6 +1427,8 @@ export default {
}
if (this.showRootDiskSizeChanger && values.rootdisksize && values.rootdisksize > 0) {
deployVmData.rootdisksize = values.rootdisksize
} else if (this.rootDiskSizeFixed > 0) {
deployVmData.rootdisksize = this.rootDiskSizeFixed
}
if (values.hypervisor && values.hypervisor.length > 0) {
deployVmData.hypervisor = values.hypervisor
@ -1958,6 +1965,10 @@ export default {
this.updateFieldValue('memory', this.selectedTemplateConfiguration.memory)
}
}
if (offering && offering.rootdisksize > 0) {
this.rootDiskSizeFixed = offering.rootdisksize / (1024 * 1024 * 1024.0).toFixed(2)
this.showRootDiskSizeChanger = false
}
}
}
}

View File

@ -70,6 +70,7 @@ public class CSExceptionErrorCode {
ExceptionErrorCodeMap.put("com.cloud.async.AsyncCommandQueued", 4540);
ExceptionErrorCodeMap.put("com.cloud.exception.RequestLimitException", 4545);
ExceptionErrorCodeMap.put("com.cloud.exception.StorageConflictException", 4550);
ExceptionErrorCodeMap.put("com.cloud.exception.UnavailableCommandException", 4555);
// Have a special error code for ServerApiException when it is
// thrown in a standalone manner when failing to detect any of the above