mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-6278
Baremetal Advanced Networking support
This commit is contained in:
parent
7b444183db
commit
3ddc9e7674
@ -1761,6 +1761,14 @@ public enum Config {
|
||||
"The maximum number of retrying times to search for an available IPv6 address in the table",
|
||||
null),
|
||||
|
||||
BaremetalPeerHypervisorType(
|
||||
"Advanced",
|
||||
ManagementServer.class,
|
||||
String.class,
|
||||
"baremetal.peer.hypervisor.type",
|
||||
"XenServer",
|
||||
"Hypervisor[Xenserver/KVM/VMWare] used to spring up virtual router for baremetal instances. The cluster having this hypervisor type must be in the same zone with baremetal cluster",
|
||||
null),
|
||||
ExternalBaremetalSystemUrl(
|
||||
"Advanced",
|
||||
ManagementServer.class,
|
||||
|
||||
@ -1738,7 +1738,7 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine.
|
||||
int startRetry = 0;
|
||||
DomainRouterVO router = null;
|
||||
for (final Iterator<HypervisorType> iter = hypervisors.iterator(); iter.hasNext();) {
|
||||
final HypervisorType hType = iter.next();
|
||||
HypervisorType hType = iter.next();
|
||||
try {
|
||||
final long id = _routerDao.getNextInSequence(Long.class, "id");
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
@ -1762,6 +1762,24 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine.
|
||||
case LXC:
|
||||
templateName = RouterTemplateLxc.valueIn(dest.getDataCenter().getId());
|
||||
break;
|
||||
case BareMetal:
|
||||
String peerHvType = _configDao.getValue(Config.BaremetalPeerHypervisorType.key());
|
||||
if (peerHvType == null) {
|
||||
throw new CloudRuntimeException(String.format("To use baremetal in advanced networking, you must set %s to type of hypervisor(e.g XenServer)" +
|
||||
" that exists in the same zone with baremetal host. That hyperivsor is used to spring up virtual router for baremetal instance", Config.BaremetalPeerHypervisorType.key()));
|
||||
}
|
||||
|
||||
hType = HypervisorType.getType(peerHvType);
|
||||
if (HypervisorType.XenServer.toString().equals(peerHvType)) {
|
||||
templateName = RouterTemplateXen.valueIn(dest.getDataCenter().getId());
|
||||
} else if (HypervisorType.KVM.toString().equals(peerHvType)) {
|
||||
templateName = RouterTemplateKvm.valueIn(dest.getDataCenter().getId());
|
||||
} else if (HypervisorType.VMware.toString().equals(peerHvType)) {
|
||||
templateName = RouterTemplateVmware.valueIn(dest.getDataCenter().getId());
|
||||
} else {
|
||||
throw new CloudRuntimeException(String.format("Baremetal only supports peer hypervisor(XenServer/KVM/VMWare) right now, you specified %s", peerHvType));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
4
utils/src/com/cloud/utils/fsm/StateObject.java
Normal file → Executable file
4
utils/src/com/cloud/utils/fsm/StateObject.java
Normal file → Executable file
@ -21,7 +21,7 @@ package com.cloud.utils.fsm;
|
||||
|
||||
public interface StateObject<S> {
|
||||
/**
|
||||
* @return finite state.
|
||||
*/
|
||||
* @return finite state.
|
||||
*/
|
||||
S getState();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user