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)/$(SYSCONFDIR)/profile.d
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/plugins 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/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/ 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 { public interface CloudianConnector extends PluggableService {
ConfigKey<Boolean> CloudianConnectorEnabled = new ConfigKey<>("Advanced", Boolean.class, "cloudian.connector.enabled", "false", 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", ConfigKey<String> CloudianAdminHost = new ConfigKey<>("Advanced", String.class, "cloudian.admin.host", "s3-admin.cloudian.com",
"The hostname of the Cloudian Admin server.", true); "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()) { if (answer != null && answer.getResult()) {
storagePoolStats.put(pool.getId(), (StorageStats)answer); 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 // 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() || if (_storagePoolStats.get(poolId) != null && _storagePoolStats.get(poolId).getCapacityBytes() != ((StorageStats)answer).getCapacityBytes()) {
pool.getUsedBytes() != ((StorageStats)answer).getByteUsed()) { if (((StorageStats)answer).getCapacityBytes() > 0) {
pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes()); pool.setCapacityBytes(((StorageStats)answer).getCapacityBytes());
if (pool.getStorageProviderName().equalsIgnoreCase(DataStoreProvider.DEFAULT_PRIMARY)) { poolNeedsUpdating = true;
pool.setUsedBytes(((StorageStats) answer).getByteUsed()); } else {
pool.setUpdateTime(new Date()); 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); _storagePoolDao.update(pool.getId(), pool);
} }
} }

View File

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

View File

@ -284,7 +284,13 @@ export default {
label: 'label.action.create.volume', label: 'label.action.create.volume',
dataView: true, dataView: true,
show: (record) => { return record.state === 'BackedUp' }, 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: { mapping: {
snapshotid: { snapshotid: {
value: (record) => { return record.id } value: (record) => { return record.id }

View File

@ -983,13 +983,13 @@ export default {
continue continue
} }
if (!input === undefined || input === null || 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') { if (param.type === 'boolean') {
params[key] = false params[key] = false
} }
break break
} }
if (!input) { if (!input && input !== 0 && !['tags'].includes(key)) {
continue continue
} }
if (action.mapping && key in action.mapping && action.mapping[key].options) { if (action.mapping && key in action.mapping && action.mapping[key].options) {

View File

@ -106,7 +106,11 @@
@update-template-iso="updateFieldValue" /> @update-template-iso="updateFieldValue" />
<span> <span>
{{ $t('label.override.rootdisk.size') }} {{ $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> <div v-if="template.deployasis"> {{ this.$t('message.deployasis') }} </div>
</span> </span>
<disk-size-selection <disk-size-selection
@ -185,7 +189,7 @@
</a-form-item> </a-form-item>
<compute-offering-selection <compute-offering-selection
:compute-items="options.serviceOfferings" :compute-items="options.serviceOfferings"
:selected-template="template" :selected-template="template ? template : {}"
:row-count="rowCount.serviceOfferings" :row-count="rowCount.serviceOfferings"
:zoneId="zoneId" :zoneId="zoneId"
:value="serviceOffering ? serviceOffering.id : ''" :value="serviceOffering ? serviceOffering.id : ''"
@ -771,7 +775,8 @@ export default {
dataPreFill: {}, dataPreFill: {},
showDetails: false, showDetails: false,
showRootDiskSizeChanger: false, showRootDiskSizeChanger: false,
securitygroupids: [] securitygroupids: [],
rootDiskSizeFixed: 0
} }
}, },
computed: { computed: {
@ -1422,6 +1427,8 @@ export default {
} }
if (this.showRootDiskSizeChanger && values.rootdisksize && values.rootdisksize > 0) { if (this.showRootDiskSizeChanger && values.rootdisksize && values.rootdisksize > 0) {
deployVmData.rootdisksize = values.rootdisksize deployVmData.rootdisksize = values.rootdisksize
} else if (this.rootDiskSizeFixed > 0) {
deployVmData.rootdisksize = this.rootDiskSizeFixed
} }
if (values.hypervisor && values.hypervisor.length > 0) { if (values.hypervisor && values.hypervisor.length > 0) {
deployVmData.hypervisor = values.hypervisor deployVmData.hypervisor = values.hypervisor
@ -1958,6 +1965,10 @@ export default {
this.updateFieldValue('memory', this.selectedTemplateConfiguration.memory) 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.async.AsyncCommandQueued", 4540);
ExceptionErrorCodeMap.put("com.cloud.exception.RequestLimitException", 4545); ExceptionErrorCodeMap.put("com.cloud.exception.RequestLimitException", 4545);
ExceptionErrorCodeMap.put("com.cloud.exception.StorageConflictException", 4550); ExceptionErrorCodeMap.put("com.cloud.exception.StorageConflictException", 4550);
ExceptionErrorCodeMap.put("com.cloud.exception.UnavailableCommandException", 4555);
// Have a special error code for ServerApiException when it is // Have a special error code for ServerApiException when it is
// thrown in a standalone manner when failing to detect any of the above // thrown in a standalone manner when failing to detect any of the above