Skip to content

Commit 3783fd5

Browse files
committed
Merge remote-tracking branch 'origin/4.15'
2 parents def65ec + 43257f8 commit 3783fd5

File tree

7 files changed

+57
-10
lines changed

7 files changed

+57
-10
lines changed

server/src/main/java/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,9 +1607,15 @@ private SetMonitorServiceCommand createMonitorServiceCommand(DomainRouterVO rout
16071607
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_BASIC_INTERVAL, RouterHealthChecksBasicInterval.value().toString());
16081608
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ADVANCED_INTERVAL, RouterHealthChecksAdvancedInterval.value().toString());
16091609
String excludedTests = RouterHealthChecksToExclude.valueIn(router.getDataCenterId());
1610-
if (router.getIsRedundantRouter() && RedundantState.BACKUP.equals(router.getRedundantState())) {
1611-
excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS;
1610+
if (router.getIsRedundantRouter()) {
1611+
// Disable gateway check if VPC has no tiers or no active VM's in it
1612+
final List<Long> routerGuestNtwkIds = _routerDao.getRouterNetworks(router.getId());
1613+
if (RedundantState.BACKUP.equals(router.getRedundantState()) ||
1614+
routerGuestNtwkIds == null || routerGuestNtwkIds.isEmpty()) {
1615+
excludedTests = excludedTests.isEmpty() ? BACKUP_ROUTER_EXCLUDED_TESTS : excludedTests + "," + BACKUP_ROUTER_EXCLUDED_TESTS;
1616+
}
16121617
}
1618+
16131619
command.setAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_EXCLUDED, excludedTests);
16141620
command.setHealthChecksConfig(getRouterHealthChecksConfig(router));
16151621
command.setReconfigureAfterUpdate(reconfigure);

systemvm/debian/etc/vpcdnsmasq.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,4 @@ log-facility=/var/log/dnsmasq.log
462462
conf-dir=/etc/dnsmasq.d
463463

464464
dhcp-optsfile=/etc/dhcpopts.txt
465+
localise-queries

systemvm/debian/opt/cloud/bin/cs/CsDhcp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ def configure_server(self):
127127
listen_address.append(gateway)
128128
else:
129129
listen_address.append(ip)
130+
# Add localized "data-server" records in /etc/hosts for VPC routers
131+
if self.config.is_vpc():
132+
self.add_host(gateway, "%s data-server" % CsHelper.get_hostname())
130133
idx += 1
131134

132135
# Listen Address

ui/.env.local

Lines changed: 0 additions & 1 deletion
This file was deleted.

ui/src/config/section/network.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
}, {
4949
name: 'public.ip.addresses',
5050
component: () => import('@/views/network/IpAddressesTab.vue'),
51-
show: (record) => { return record.type === 'Isolated' && !('vpcid' in record) && 'listPublicIpAddresses' in store.getters.apis }
51+
show: (record) => { return (record.type === 'Isolated' || record.type === 'Shared') && !('vpcid' in record) && 'listPublicIpAddresses' in store.getters.apis }
5252
}, {
5353
name: 'virtual.routers',
5454
component: () => import('@/views/network/RoutersTab.vue'),

ui/src/views/compute/InstanceTab.vue

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
icon="environment"
103103
shape="circle"
104104
:disabled="(!('addIpToNic' in $store.getters.apis) && !('addIpToNic' in $store.getters.apis))"
105-
@click="fetchSecondaryIPs(record.nic.id)" />
105+
@click="onAcquireSecondaryIPAddress(record)" />
106106
</a-tooltip>
107107
<a-tooltip placement="bottom">
108108
<template slot="title">
@@ -220,7 +220,23 @@
220220
{{ $t('message.network.secondaryip') }}
221221
</p>
222222
<a-divider />
223-
<a-input :placeholder="$t('label.new.secondaryip.description')" v-model="newSecondaryIp" autoFocus></a-input>
223+
<div class="modal-form">
224+
<p class="modal-form__label">{{ $t('label.publicip') }}:</p>
225+
<a-select
226+
showSearch
227+
v-if="editNicResource.type==='Shared'"
228+
v-model="newSecondaryIp"
229+
:loading="listIps.loading">
230+
<a-select-option v-for="ip in listIps.opts" :key="ip.ipaddress">
231+
{{ ip.ipaddress }}
232+
</a-select-option>
233+
</a-select>
234+
<a-input
235+
v-else
236+
:placeholder="$t('label.new.secondaryip.description')"
237+
v-model="newSecondaryIp"></a-input>
238+
</div>
239+
224240
<div style="margin-top: 10px; display: flex; justify-content:flex-end;">
225241
<a-button @click="submitSecondaryIP" type="primary" style="margin-right: 10px;">{{ $t('label.add.secondary.ip') }}</a-button>
226242
<a-button @click="closeModals">{{ $t('label.close') }}</a-button>
@@ -298,6 +314,7 @@ export default {
298314
loadingNic: false,
299315
editIpAddressNic: '',
300316
editIpAddressValue: '',
317+
editNetworkId: '',
301318
secondaryIPs: [],
302319
selectedNicId: '',
303320
newSecondaryIp: '',
@@ -444,6 +461,17 @@ export default {
444461
this.fetchPublicIps(record.nic.networkid)
445462
}
446463
},
464+
onAcquireSecondaryIPAddress (record) {
465+
if (record.nic.type === 'Shared') {
466+
this.fetchPublicIps(record.nic.networkid)
467+
} else {
468+
this.listIps.opts = []
469+
}
470+
471+
this.editNicResource = record.nic
472+
this.editNetworkId = record.nic.networkid
473+
this.fetchSecondaryIPs(record.nic.id)
474+
},
447475
submitAddNetwork () {
448476
const params = {}
449477
params.virtualmachineid = this.vm.id
@@ -613,6 +641,9 @@ export default {
613641
}).catch(error => {
614642
this.$notifyError(error)
615643
this.loadingNic = false
644+
}).finally(() => {
645+
this.newSecondaryIp = null
646+
this.fetchPublicIps(this.editNetworkId)
616647
})
617648
},
618649
removeSecondaryIP (id) {
@@ -625,6 +656,7 @@ export default {
625656
successMethod: () => {
626657
this.loadingNic = false
627658
this.fetchSecondaryIPs(this.selectedNicId)
659+
this.fetchPublicIps(this.editNetworkId)
628660
this.parentFetchData()
629661
},
630662
errorMessage: this.$t('message.error.remove.secondary.ipaddress'),

ui/src/views/network/IpAddressesTab.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div>
2020
<a-spin :spinning="fetchLoading">
2121
<a-button
22-
:disabled="!('associateIpAddress' in $store.getters.apis)"
22+
:disabled="!('associateIpAddress' in $store.getters.apis) || resource.type === 'Shared'"
2323
type="dashed"
2424
icon="plus"
2525
style="width: 100%; margin-bottom: 15px"
@@ -52,7 +52,8 @@
5252
:rowKey="item => item.id"
5353
:pagination="false" >
5454
<template slot="ipaddress" slot-scope="text, record">
55-
<router-link :to="{ path: '/publicip/' + record.id }" >{{ text }} </router-link>
55+
<router-link v-if="record.forvirtualnetwork === true" :to="{ path: '/publicip/' + record.id }" >{{ text }} </router-link>
56+
<div v-else>{{ text }}</div>
5657
<a-tag v-if="record.issourcenat === true">source-nat</a-tag>
5758
</template>
5859

@@ -66,12 +67,13 @@
6667
</template>
6768

6869
<template slot="associatednetworkname" slot-scope="text, record">
69-
<router-link :to="{ path: '/guestnetwork/' + record.associatednetworkid }" > {{ record.associatednetworkname || record.associatednetworkid }} </router-link>
70+
<router-link v-if="record.forvirtualnetwork === true" :to="{ path: '/guestnetwork/' + record.associatednetworkid }" > {{ record.associatednetworkname || record.associatednetworkid }} </router-link>
71+
<div v-else>{{ record.networkname }}</div>
7072
</template>
7173

7274
<template slot="action" slot-scope="text, record">
7375
<a-button
74-
v-if="record.issourcenat !== true"
76+
v-if="record.issourcenat !== true && record.forvirtualnetwork === true"
7577
type="danger"
7678
icon="delete"
7779
shape="circle"
@@ -212,6 +214,10 @@ export default {
212214
if (this.vpcTier) {
213215
params.associatednetworkid = this.vpcTier
214216
}
217+
} else if (this.resource.type === 'Shared') {
218+
params.networkid = this.resource.id
219+
params.allocatedonly = false
220+
params.forvirtualnetwork = false
215221
} else {
216222
params.associatednetworkid = this.resource.id
217223
}

0 commit comments

Comments
 (0)