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", |             "The maximum number of retrying times to search for an available IPv6 address in the table", | ||||||
|             null), |             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( |     ExternalBaremetalSystemUrl( | ||||||
|             "Advanced", |             "Advanced", | ||||||
|             ManagementServer.class, |             ManagementServer.class, | ||||||
|  | |||||||
| @ -1738,7 +1738,7 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine. | |||||||
|         int startRetry = 0; |         int startRetry = 0; | ||||||
|         DomainRouterVO router = null; |         DomainRouterVO router = null; | ||||||
|         for (final Iterator<HypervisorType> iter = hypervisors.iterator(); iter.hasNext();) { |         for (final Iterator<HypervisorType> iter = hypervisors.iterator(); iter.hasNext();) { | ||||||
|             final HypervisorType hType = iter.next(); |             HypervisorType hType = iter.next(); | ||||||
|             try { |             try { | ||||||
|                 final long id = _routerDao.getNextInSequence(Long.class, "id"); |                 final long id = _routerDao.getNextInSequence(Long.class, "id"); | ||||||
|                 if (s_logger.isDebugEnabled()) { |                 if (s_logger.isDebugEnabled()) { | ||||||
| @ -1762,6 +1762,24 @@ VirtualMachineGuru, Listener, Configurable, StateListener<State, VirtualMachine. | |||||||
|                 case LXC: |                 case LXC: | ||||||
|                     templateName = RouterTemplateLxc.valueIn(dest.getDataCenter().getId()); |                     templateName = RouterTemplateLxc.valueIn(dest.getDataCenter().getId()); | ||||||
|                     break; |                     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: |                 default: | ||||||
|                     break; |                     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> { | public interface StateObject<S> { | ||||||
|     /** |     /** | ||||||
|     * @return finite state. |      * @return finite state. | ||||||
|     */ |      */ | ||||||
|     S getState(); |     S getState(); | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user