mirror of https://github.com/apache/cloudstack.git
Merge remote-tracking branch 'origin/4.15' into main
This commit is contained in:
commit
953f5b81ed
|
|
@ -24,7 +24,7 @@ import org.apache.cloudstack.api.InternalIdentity;
|
||||||
|
|
||||||
public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdentity, Displayable {
|
public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdentity, Displayable {
|
||||||
enum State {
|
enum State {
|
||||||
Pending, Connected, Disconnected, Error,
|
Pending, Connecting, Connected, Disconnected, Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -819,7 +819,8 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
|
||||||
}
|
}
|
||||||
final List<String> ipList = new ArrayList<String>();
|
final List<String> ipList = new ArrayList<String>();
|
||||||
for (final Site2SiteVpnConnectionVO conn : conns) {
|
for (final Site2SiteVpnConnectionVO conn : conns) {
|
||||||
if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected) {
|
if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected
|
||||||
|
&& conn.getState() != Site2SiteVpnConnection.State.Connecting) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final Site2SiteCustomerGateway gw = _s2sCustomerGatewayDao.findById(conn.getCustomerGatewayId());
|
final Site2SiteCustomerGateway gw = _s2sCustomerGatewayDao.findById(conn.getCustomerGatewayId());
|
||||||
|
|
@ -855,7 +856,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
|
||||||
throw new CloudRuntimeException("Unable to acquire lock for site to site vpn connection id " + conn.getId());
|
throw new CloudRuntimeException("Unable to acquire lock for site to site vpn connection id " + conn.getId());
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected) {
|
if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected && conn.getState() != Site2SiteVpnConnection.State.Connecting) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final Site2SiteVpnConnection.State oldState = conn.getState();
|
final Site2SiteVpnConnection.State oldState = conn.getState();
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
||||||
if (conn.isPassive()) {
|
if (conn.isPassive()) {
|
||||||
conn.setState(State.Disconnected);
|
conn.setState(State.Disconnected);
|
||||||
} else {
|
} else {
|
||||||
conn.setState(State.Connected);
|
conn.setState(State.Connecting);
|
||||||
}
|
}
|
||||||
_vpnConnectionDao.persist(conn);
|
_vpnConnectionDao.persist(conn);
|
||||||
return conn;
|
return conn;
|
||||||
|
|
@ -530,7 +530,7 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (conn.getState() == State.Connected || conn.getState() == State.Error) {
|
if (conn.getState() == State.Connected || conn.getState() == State.Connecting || conn.getState() == State.Error) {
|
||||||
stopVpnConnection(conn.getId());
|
stopVpnConnection(conn.getId());
|
||||||
}
|
}
|
||||||
startVpnConnection(conn.getId());
|
startVpnConnection(conn.getId());
|
||||||
|
|
@ -608,7 +608,8 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
||||||
if (conn.getState() == State.Pending) {
|
if (conn.getState() == State.Pending) {
|
||||||
conn.setState(State.Disconnected);
|
conn.setState(State.Disconnected);
|
||||||
}
|
}
|
||||||
if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
|
if (conn.getState() == State.Connected || conn.getState() == State.Error
|
||||||
|
|| conn.getState() == State.Disconnected || conn.getState() == State.Connecting) {
|
||||||
stopVpnConnection(id);
|
stopVpnConnection(id);
|
||||||
}
|
}
|
||||||
startVpnConnection(id);
|
startVpnConnection(id);
|
||||||
|
|
@ -795,7 +796,7 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
||||||
throw new CloudRuntimeException("Unable to acquire lock on " + conn);
|
throw new CloudRuntimeException("Unable to acquire lock on " + conn);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (conn.getState() == Site2SiteVpnConnection.State.Connected) {
|
if (conn.getState() == Site2SiteVpnConnection.State.Connected || conn.getState() == Site2SiteVpnConnection.State.Connecting) {
|
||||||
conn.setState(Site2SiteVpnConnection.State.Disconnected);
|
conn.setState(Site2SiteVpnConnection.State.Disconnected);
|
||||||
_vpnConnectionDao.persist(conn);
|
_vpnConnectionDao.persist(conn);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -618,7 +618,7 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
|
||||||
self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
|
self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
|
||||||
|
|
||||||
vm1 = None
|
vm1 = None
|
||||||
# Deploy a vm in network 2
|
# Deploy a vm in network 1
|
||||||
try:
|
try:
|
||||||
vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
|
vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
|
||||||
templateid=self.template.id,
|
templateid=self.template.id,
|
||||||
|
|
@ -990,7 +990,7 @@ class TestRVPCSite2SiteVpn(cloudstackTestCase):
|
||||||
self.cleanup.append(ntwk2)
|
self.cleanup.append(ntwk2)
|
||||||
self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
|
self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
|
||||||
|
|
||||||
# Deploy a vm in network 2
|
# Deploy a vm in network 1
|
||||||
vm1 = None
|
vm1 = None
|
||||||
try:
|
try:
|
||||||
vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
|
vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
|
||||||
|
|
@ -1370,7 +1370,7 @@ class TestVPCSite2SiteVPNMultipleOptions(cloudstackTestCase):
|
||||||
self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
|
self.logger.debug("Network %s created in VPC %s" % (ntwk2.id, vpc2.id))
|
||||||
|
|
||||||
vm1 = None
|
vm1 = None
|
||||||
# Deploy a vm in network 2
|
# Deploy a vm in network 1
|
||||||
try:
|
try:
|
||||||
vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
|
vm1 = VirtualMachine.create(self.apiclient, services=self.services["virtual_machine"],
|
||||||
templateid=self.template.id,
|
templateid=self.template.id,
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,11 @@
|
||||||
<a-step
|
<a-step
|
||||||
v-for="(step, index) in steps"
|
v-for="(step, index) in steps"
|
||||||
:ref="`resourceStep${index}`"
|
:ref="`resourceStep${index}`"
|
||||||
:key="step.title"
|
:key="step.formKey"
|
||||||
:title="$t(step.title)"></a-step>
|
:title="$t(step.title)"></a-step>
|
||||||
</a-steps>
|
</a-steps>
|
||||||
<static-inputs-form
|
<static-inputs-form
|
||||||
v-if="currentStep === 0"
|
v-if="checkVisibleResource('clusterResource')"
|
||||||
@nextPressed="nextPressed"
|
@nextPressed="nextPressed"
|
||||||
@backPressed="handleBack"
|
@backPressed="handleBack"
|
||||||
@fieldsChanged="fieldsChanged"
|
@fieldsChanged="fieldsChanged"
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
<div v-if="hypervisor !== 'VMware'">
|
<div v-if="hypervisor !== 'VMware'">
|
||||||
<static-inputs-form
|
<static-inputs-form
|
||||||
v-if="currentStep === 1"
|
v-if="checkVisibleResource('hostResource')"
|
||||||
@nextPressed="nextPressed"
|
@nextPressed="nextPressed"
|
||||||
@backPressed="handleBack"
|
@backPressed="handleBack"
|
||||||
@fieldsChanged="fieldsChanged"
|
@fieldsChanged="fieldsChanged"
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
:isFixError="isFixError"
|
:isFixError="isFixError"
|
||||||
/>
|
/>
|
||||||
<static-inputs-form
|
<static-inputs-form
|
||||||
v-if="currentStep === 2"
|
v-if="(!localstorageenabled || !localstorageenabledforsystemvm) && checkVisibleResource('primaryResource')"
|
||||||
@nextPressed="nextPressed"
|
@nextPressed="nextPressed"
|
||||||
@backPressed="handleBack"
|
@backPressed="handleBack"
|
||||||
@fieldsChanged="fieldsChanged"
|
@fieldsChanged="fieldsChanged"
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
:isFixError="isFixError"
|
:isFixError="isFixError"
|
||||||
/>
|
/>
|
||||||
<static-inputs-form
|
<static-inputs-form
|
||||||
v-if="currentStep === 3"
|
v-if="checkVisibleResource('secondaryResource')"
|
||||||
@nextPressed="nextPressed"
|
@nextPressed="nextPressed"
|
||||||
@backPressed="handleBack"
|
@backPressed="handleBack"
|
||||||
@fieldsChanged="fieldsChanged"
|
@fieldsChanged="fieldsChanged"
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<static-inputs-form
|
<static-inputs-form
|
||||||
v-if="currentStep === 1"
|
v-if="checkVisibleResource('primaryResource')"
|
||||||
@nextPressed="nextPressed"
|
@nextPressed="nextPressed"
|
||||||
@backPressed="handleBack"
|
@backPressed="handleBack"
|
||||||
@fieldsChanged="fieldsChanged"
|
@fieldsChanged="fieldsChanged"
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
:isFixError="isFixError"
|
:isFixError="isFixError"
|
||||||
/>
|
/>
|
||||||
<static-inputs-form
|
<static-inputs-form
|
||||||
v-if="currentStep === 2"
|
v-if="checkVisibleResource('secondaryResource')"
|
||||||
@nextPressed="nextPressed"
|
@nextPressed="nextPressed"
|
||||||
@backPressed="handleBack"
|
@backPressed="handleBack"
|
||||||
@fieldsChanged="fieldsChanged"
|
@fieldsChanged="fieldsChanged"
|
||||||
|
|
@ -135,11 +135,15 @@ export default {
|
||||||
hypervisor () {
|
hypervisor () {
|
||||||
return this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
|
return this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
|
||||||
},
|
},
|
||||||
|
localstorageenabled () {
|
||||||
|
return this.prefillContent?.localstorageenabled?.value || false
|
||||||
|
},
|
||||||
|
localstorageenabledforsystemvm () {
|
||||||
|
return this.prefillContent?.localstorageenabledforsystemvm?.value || false
|
||||||
|
},
|
||||||
steps () {
|
steps () {
|
||||||
const steps = []
|
const steps = []
|
||||||
const hypervisor = this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
|
const hypervisor = this.prefillContent.hypervisor ? this.prefillContent.hypervisor.value : null
|
||||||
const localStorageEnabled = this.prefillContent.localstorageenabled.value
|
|
||||||
const localStorageEnabledForSystemVM = this.prefillContent.localstorageenabledforsystemvm.value
|
|
||||||
steps.push({
|
steps.push({
|
||||||
title: 'label.cluster',
|
title: 'label.cluster',
|
||||||
fromKey: 'clusterResource',
|
fromKey: 'clusterResource',
|
||||||
|
|
@ -152,7 +156,7 @@ export default {
|
||||||
description: 'message.desc.host'
|
description: 'message.desc.host'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (!localStorageEnabled || !localStorageEnabledForSystemVM) {
|
if (!this.localstorageenabled || !this.localstorageenabledforsystemvm) {
|
||||||
steps.push({
|
steps.push({
|
||||||
title: 'label.primary.storage',
|
title: 'label.primary.storage',
|
||||||
fromKey: 'primaryResource',
|
fromKey: 'primaryResource',
|
||||||
|
|
@ -926,6 +930,10 @@ export default {
|
||||||
},
|
},
|
||||||
submitLaunchZone () {
|
submitLaunchZone () {
|
||||||
this.$emit('submitLaunchZone')
|
this.$emit('submitLaunchZone')
|
||||||
|
},
|
||||||
|
checkVisibleResource (key) {
|
||||||
|
const formKey = this.steps[this.currentStep]?.fromKey || ''
|
||||||
|
return formKey === key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue