Merge remote-tracking branch 'origin/4.15'

This commit is contained in:
Rohit Yadav 2021-06-27 18:25:46 +05:30
commit f58b72f6f7
15 changed files with 56 additions and 19 deletions

View File

@ -253,6 +253,8 @@ public class VMEntityManagerImpl implements VMEntityManager {
} }
_itMgr.start(vm.getUuid(), params, plan, null); _itMgr.start(vm.getUuid(), params, plan, null);
} else {
throw ex;
} }
} }
} else { } else {

View File

@ -64,10 +64,6 @@ public class CephSnapshotStrategy extends StorageSystemSnapshotStrategy {
return StrategyPriority.HIGHEST; return StrategyPriority.HIGHEST;
} }
if (SnapshotOperation.DELETE.equals(op)) {
return StrategyPriority.HIGHEST;
}
return StrategyPriority.CANT_HANDLE; return StrategyPriority.CANT_HANDLE;
} }

View File

@ -87,8 +87,6 @@ public class CephSnapshotStrategyTest {
StrategyPriority strategyPriority = cephSnapshotStrategy.canHandle(snapshot, snapshotOps[i]); StrategyPriority strategyPriority = cephSnapshotStrategy.canHandle(snapshot, snapshotOps[i]);
if (snapshotOps[i] == SnapshotOperation.REVERT && isSnapshotStoredOnRbdStoragePool) { if (snapshotOps[i] == SnapshotOperation.REVERT && isSnapshotStoredOnRbdStoragePool) {
Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority); Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority);
} else if (snapshotOps[i] == SnapshotOperation.DELETE && isSnapshotStoredOnRbdStoragePool) {
Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority);
} else { } else {
Assert.assertEquals(StrategyPriority.CANT_HANDLE, strategyPriority); Assert.assertEquals(StrategyPriority.CANT_HANDLE, strategyPriority);
} }

View File

@ -398,7 +398,7 @@ install -D tools/whisker/LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/%{name}-inte
/usr/bin/systemctl off cloudstack-management || true /usr/bin/systemctl off cloudstack-management || true
%pre management %pre management
id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \ id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -U -c "CloudStack unprivileged user" \
-r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true -r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true
rm -rf %{_localstatedir}/cache/cloudstack rm -rf %{_localstatedir}/cache/cloudstack
@ -484,7 +484,7 @@ fi
systemctl daemon-reload systemctl daemon-reload
%pre usage %pre usage
id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \ id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -U -c "CloudStack unprivileged user" \
-r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true -r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true
%preun usage %preun usage

View File

@ -391,7 +391,7 @@ install -D tools/whisker/LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/%{name}-inte
/usr/bin/systemctl off cloudstack-management || true /usr/bin/systemctl off cloudstack-management || true
%pre management %pre management
id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \ id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -U -c "CloudStack unprivileged user" \
-r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true -r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true
rm -rf %{_localstatedir}/cache/cloudstack rm -rf %{_localstatedir}/cache/cloudstack
@ -475,7 +475,7 @@ fi
systemctl daemon-reload systemctl daemon-reload
%pre usage %pre usage
id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \ id cloud > /dev/null 2>&1 || /usr/sbin/useradd -M -U -c "CloudStack unprivileged user" \
-r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true -r -s /bin/sh -d %{_localstatedir}/cloudstack/management cloud|| true
%preun usage %preun usage

View File

@ -261,7 +261,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
private final GlobalLock _allocLock = GlobalLock.getInternLock(getAllocLockName()); private final GlobalLock _allocLock = GlobalLock.getInternLock(getAllocLockName());
static final ConfigKey<String> NTPServerConfig = new ConfigKey<String>(String.class, "ntp.server.list", "Advanced", null, static final ConfigKey<String> NTPServerConfig = new ConfigKey<String>(String.class, "ntp.server.list", "Advanced", null,
"Comma separated list of NTP servers to configure in Secondary storage VM", false, ConfigKey.Scope.Global, null); "Comma separated list of NTP servers to configure in Secondary storage VM", true, ConfigKey.Scope.Global, null);
static final ConfigKey<Integer> MaxNumberOfSsvmsForMigration = new ConfigKey<Integer>("Advanced", Integer.class, "max.ssvm.count", "5", static final ConfigKey<Integer> MaxNumberOfSsvmsForMigration = new ConfigKey<Integer>("Advanced", Integer.class, "max.ssvm.count", "5",
"Number of additional SSVMs to handle migration of data objects concurrently", true, ConfigKey.Scope.Global); "Number of additional SSVMs to handle migration of data objects concurrently", true, ConfigKey.Scope.Global);

View File

@ -111,7 +111,7 @@ class CsAcl(CsDataBag):
self.rule['allowed'] = True self.rule['allowed'] = True
self.rule['action'] = "ACCEPT" self.rule['action'] = "ACCEPT"
if self.rule['type'] == 'all' and obj['source_cidr_list']: if self.rule['type'] == 'all' and not obj['source_cidr_list']:
self.rule['cidr'] = [] self.rule['cidr'] = []
else: else:
self.rule['cidr'] = obj['source_cidr_list'] self.rule['cidr'] = obj['source_cidr_list']

View File

@ -567,14 +567,12 @@ setup_ntp() {
if [ -f $NTP_CONF_FILE ] if [ -f $NTP_CONF_FILE ]
then then
IFS=',' read -a server_list <<< "$NTP_SERVER_LIST" IFS=',' read -a server_list <<< "$NTP_SERVER_LIST"
sed -i "/^server /d" $NTP_CONF_FILE
for (( iterator=${#server_list[@]}-1 ; iterator>=0 ; iterator-- )) for (( iterator=${#server_list[@]}-1 ; iterator>=0 ; iterator-- ))
do do
server=$(echo ${server_list[iterator]} | tr -d '\r') server=$(echo ${server_list[iterator]} | tr -d '\r')
PATTERN="server $server" PATTERN="server $server"
if grep -q "^$PATTERN$" $NTP_CONF_FILE ; then sed -i "0,/^#server/s//$PATTERN\n#server/" $NTP_CONF_FILE
sed -i "/^$PATTERN$/d" $NTP_CONF_FILE
fi
sed -i "0,/^server/s//$PATTERN\nserver/" $NTP_CONF_FILE
done done
systemctl enable ntp systemctl enable ntp
else else

View File

@ -100,6 +100,13 @@ setup_router() {
mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1 mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1
fi fi
# Setup hourly lograte in systemd timer
sed -i 's/OnCalendar=daily/OnCalendar=hourly/g' /usr/lib/systemd/system/logrotate.timer
sed -i 's/AccuracySec=12h/AccuracySec=5m/g' /usr/lib/systemd/system/logrotate.timer
# reload daemon
/usr/bin/systemctl daemon-reload
# Load modules to support NAT traversal in VR # Load modules to support NAT traversal in VR
modprobe nf_nat_pptp modprobe nf_nat_pptp
} }

View File

@ -113,6 +113,13 @@ EOF
mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1 mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1
fi fi
# Setup hourly lograte in systemd timer
sed -i 's/OnCalendar=daily/OnCalendar=hourly/g' /usr/lib/systemd/system/logrotate.timer
sed -i 's/AccuracySec=12h/AccuracySec=5m/g' /usr/lib/systemd/system/logrotate.timer
# reload daemon
/usr/bin/systemctl daemon-reload
# Load modules to support NAT traversal in VR # Load modules to support NAT traversal in VR
modprobe nf_nat_pptp modprobe nf_nat_pptp
} }

View File

@ -58,7 +58,7 @@ export default {
} }
}, },
watch: { watch: {
actions (item) { resource () {
this.actionsExist = this.doActionsExist() this.actionsExist = this.doActionsExist()
} }
}, },

View File

@ -76,7 +76,7 @@
<a-input ref="input" :value="inputKey" @change="e => inputKey = e.target.value" style="width: 50px; text-align: center" :placeholder="$t('label.key')" /> <a-input ref="input" :value="inputKey" @change="e => inputKey = e.target.value" style="width: 50px; text-align: center" :placeholder="$t('label.key')" />
<a-input style=" width: 20px; border-left: 0; pointer-events: none; backgroundColor: #fff" placeholder="=" disabled /> <a-input style=" width: 20px; border-left: 0; pointer-events: none; backgroundColor: #fff" placeholder="=" disabled />
<a-input :value="inputValue" @change="handleValueChange" style="width: 50px; text-align: center; border-left: 0" :placeholder="$t('label.value')" /> <a-input :value="inputValue" @change="handleValueChange" style="width: 50px; text-align: center; border-left: 0" :placeholder="$t('label.value')" />
<tooltip-button icon="close" size="small" @click="inputKey = inputValue = ''" /> <tooltip-button :tooltip="$t('label.clear')" icon="close" size="small" @click="inputKey = inputValue = ''" />
</a-input-group> </a-input-group>
</div> </div>
</div> </div>
@ -112,9 +112,13 @@
<script> <script>
import { api } from '@/api' import { api } from '@/api'
import TooltipButton from '@/components/view/TooltipButton'
export default { export default {
name: 'SearchView', name: 'SearchView',
components: {
TooltipButton
},
props: { props: {
searchFilters: { searchFilters: {
type: Array, type: Array,

View File

@ -145,6 +145,17 @@ export default {
virtualmachineid: { virtualmachineid: {
value: (record) => { return record.id } value: (record) => { return record.id }
} }
},
successMethod: (obj, result) => {
const vm = result.jobresult.virtualmachine || {}
if (result.jobstatus === 1 && vm.password) {
const name = vm.displayname || vm.name || vm.id
obj.$notification.success({
message: `${obj.$t('label.reinstall.vm')}: ` + name,
description: `${obj.$t('label.password.reset.confirm')}: ` + vm.password,
duration: 0
})
}
} }
}, },
{ {
@ -339,6 +350,17 @@ export default {
domainid: { domainid: {
value: (record) => { return record.domainid } value: (record) => { return record.domainid }
} }
},
successMethod: (obj, result) => {
const vm = result.jobresult.virtualmachine || {}
if (result.jobstatus === 1 && vm.password) {
const name = vm.displayname || vm.name || vm.id
obj.$notification.success({
message: `${obj.$t('label.reset.ssh.key.pair.on.vm')}: ` + name,
description: `${obj.$t('label.password.reset.confirm')}: ` + vm.password,
duration: 0
})
}
} }
}, },
{ {

View File

@ -871,6 +871,9 @@ export default {
}) })
} }
} }
if ('successMethod' in action) {
action.successMethod(this, result)
}
}, },
errorMethod: () => this.fetchData(), errorMethod: () => this.fetchData(),
loadingMessage: `${this.$t(action.label)} - ${resourceName}`, loadingMessage: `${this.$t(action.label)} - ${resourceName}`,

View File

@ -2012,7 +2012,7 @@ export default {
} }
} }
if (offering && offering.rootdisksize > 0) { if (offering && offering.rootdisksize > 0) {
this.rootDiskSizeFixed = offering.rootdisksize / (1024 * 1024 * 1024.0).toFixed(2) this.rootDiskSizeFixed = offering.rootdisksize
this.showRootDiskSizeChanger = false this.showRootDiskSizeChanger = false
} }
} }