Merge remote-tracking branch 'origin/4.15'

This commit is contained in:
Rohit Yadav 2021-04-05 13:00:18 +05:30
commit 3783fd5cec
7 changed files with 57 additions and 10 deletions

View File

@ -1607,9 +1607,15 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_BASIC_INTERVAL, RouterHealthChecksBasicInterval.value().toString());
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ADVANCED_INTERVAL, RouterHealthChecksAdvancedInterval.value().toString());
String excludedTests = RouterHealthChecksToExclude.valueIn(router.getDataCenterId());
if (router.getIsRedundantRouter() && RedundantState.BACKUP.equals(router.getRedundantState())) {
excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS;
if (router.getIsRedundantRouter()) {
// Disable gateway check if VPC has no tiers or no active VM's in it
final List<Long> routerGuestNtwkIds = _routerDao.getRouterNetworks(router.getId());
if (RedundantState.BACKUP.equals(router.getRedundantState()) ||
routerGuestNtwkIds == null || routerGuestNtwkIds.isEmpty()) {
excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS;
}
}
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_EXCLUDED, excludedTests);
command.setHealthChecksConfig(getRouterHealthChecksConfig(router));
command.setReconfigureAfterUpdate(reconfigure);

View File

@ -462,3 +462,4 @@ log-facility=/var/log/dnsmasq.log
conf-dir=/etc/dnsmasq.d
dhcp-optsfile=/etc/dhcpopts.txt
localise-queries

View File

@ -127,6 +127,9 @@ class CsDhcp(CsDataBag):
listen_address.append(gateway)
else:
listen_address.append(ip)
# Add localized "data-server" records in /etc/hosts for VPC routers
if self.config.is_vpc():
self.add_host(gateway, "%s data-server" % CsHelper.get_hostname())
idx += 1
# Listen Address

View File

@ -1 +0,0 @@
CS_URL=http://10.0.35.240:8080

View File

@ -48,7 +48,7 @@ export default {
}, {
name: 'public.ip.addresses',
component: () => import('@/views/network/IpAddressesTab.vue'),
show: (record) => { return record.type === 'Isolated' && !('vpcid' in record) && 'listPublicIpAddresses' in store.getters.apis }
show: (record) => { return (record.type === 'Isolated' || record.type === 'Shared') && !('vpcid' in record) && 'listPublicIpAddresses' in store.getters.apis }
}, {
name: 'virtual.routers',
component: () => import('@/views/network/RoutersTab.vue'),

View File

@ -102,7 +102,7 @@
icon="environment"
shape="circle"
:disabled="(!('addIpToNic' in $store.getters.apis) && !('addIpToNic' in $store.getters.apis))"
@click="fetchSecondaryIPs(record.nic.id)" />
@click="onAcquireSecondaryIPAddress(record)" />
</a-tooltip>
<a-tooltip placement="bottom">
<template slot="title">
@ -220,7 +220,23 @@
{{ $t('message.network.secondaryip') }}
</p>
<a-divider />
<a-input :placeholder="$t('label.new.secondaryip.description')" v-model="newSecondaryIp" autoFocus></a-input>
<div class="modal-form">
<p class="modal-form__label">{{ $t('label.publicip') }}:</p>
<a-select
showSearch
v-if="editNicResource.type==='Shared'"
v-model="newSecondaryIp"
:loading="listIps.loading">
<a-select-option v-for="ip in listIps.opts" :key="ip.ipaddress">
{{ ip.ipaddress }}
</a-select-option>
</a-select>
<a-input
v-else
:placeholder="$t('label.new.secondaryip.description')"
v-model="newSecondaryIp"></a-input>
</div>
<div style="margin-top: 10px; display: flex; justify-content:flex-end;">
<a-button @click="submitSecondaryIP" type="primary" style="margin-right: 10px;">{{ $t('label.add.secondary.ip') }}</a-button>
<a-button @click="closeModals">{{ $t('label.close') }}</a-button>
@ -298,6 +314,7 @@ export default {
loadingNic: false,
editIpAddressNic: '',
editIpAddressValue: '',
editNetworkId: '',
secondaryIPs: [],
selectedNicId: '',
newSecondaryIp: '',
@ -444,6 +461,17 @@ export default {
this.fetchPublicIps(record.nic.networkid)
}
},
onAcquireSecondaryIPAddress (record) {
if (record.nic.type === 'Shared') {
this.fetchPublicIps(record.nic.networkid)
} else {
this.listIps.opts = []
}
this.editNicResource = record.nic
this.editNetworkId = record.nic.networkid
this.fetchSecondaryIPs(record.nic.id)
},
submitAddNetwork () {
const params = {}
params.virtualmachineid = this.vm.id
@ -613,6 +641,9 @@ export default {
}).catch(error => {
this.$notifyError(error)
this.loadingNic = false
}).finally(() => {
this.newSecondaryIp = null
this.fetchPublicIps(this.editNetworkId)
})
},
removeSecondaryIP (id) {
@ -625,6 +656,7 @@ export default {
successMethod: () => {
this.loadingNic = false
this.fetchSecondaryIPs(this.selectedNicId)
this.fetchPublicIps(this.editNetworkId)
this.parentFetchData()
},
errorMessage: this.$t('message.error.remove.secondary.ipaddress'),

View File

@ -19,7 +19,7 @@
<div>
<a-spin :spinning="fetchLoading">
<a-button
:disabled="!('associateIpAddress' in $store.getters.apis)"
:disabled="!('associateIpAddress' in $store.getters.apis) || resource.type === 'Shared'"
type="dashed"
icon="plus"
style="width: 100%; margin-bottom: 15px"
@ -52,7 +52,8 @@
:rowKey="item => item.id"
:pagination="false" >
<template slot="ipaddress" slot-scope="text, record">
<router-link :to="{ path: '/publicip/' + record.id }" >{{ text }} </router-link>
<router-link v-if="record.forvirtualnetwork === true" :to="{ path: '/publicip/' + record.id }" >{{ text }} </router-link>
<div v-else>{{ text }}</div>
<a-tag v-if="record.issourcenat === true">source-nat</a-tag>
</template>
@ -66,12 +67,13 @@
</template>
<template slot="associatednetworkname" slot-scope="text, record">
<router-link :to="{ path: '/guestnetwork/' + record.associatednetworkid }" > {{ record.associatednetworkname || record.associatednetworkid }} </router-link>
<router-link v-if="record.forvirtualnetwork === true" :to="{ path: '/guestnetwork/' + record.associatednetworkid }" > {{ record.associatednetworkname || record.associatednetworkid }} </router-link>
<div v-else>{{ record.networkname }}</div>
</template>
<template slot="action" slot-scope="text, record">
<a-button
v-if="record.issourcenat !== true"
v-if="record.issourcenat !== true && record.forvirtualnetwork === true"
type="danger"
icon="delete"
shape="circle"
@ -212,6 +214,10 @@ export default {
if (this.vpcTier) {
params.associatednetworkid = this.vpcTier
}
} else if (this.resource.type === 'Shared') {
params.networkid = this.resource.id
params.allocatedonly = false
params.forvirtualnetwork = false
} else {
params.associatednetworkid = this.resource.id
}