mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	
							parent
							
								
									1bd47d38cb
								
							
						
					
					
						commit
						11d45654a6
					
				| @ -232,7 +232,7 @@ public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd { | |||||||
|                 responseObject.setResponseName(getCommandName()); |                 responseObject.setResponseName(getCommandName()); | ||||||
|             } |             } | ||||||
|         } catch (Exception ex) { |         } catch (Exception ex) { | ||||||
|             // TODO what will happen if Resource Layer fails in a step inbetween |             // TODO what will happen if Resource Layer fails in a step in between | ||||||
|             s_logger.warn("Failed to create autoscale vm group", ex); |             s_logger.warn("Failed to create autoscale vm group", ex); | ||||||
|         } finally { |         } finally { | ||||||
|             if (!success || vmGroup == null) { |             if (!success || vmGroup == null) { | ||||||
|  | |||||||
| @ -949,7 +949,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra | |||||||
| 
 | 
 | ||||||
|             /** |             /** | ||||||
|              * private transaction method to run over the objects and determine nic requirements |              * private transaction method to run over the objects and determine nic requirements | ||||||
|              * @return the total numer of nics required |              * @return the total number of nics required | ||||||
|              */ |              */ | ||||||
|             private int determineNumberOfNicsRequired() { |             private int determineNumberOfNicsRequired() { | ||||||
|                 int size = 0; |                 int size = 0; | ||||||
| @ -1183,7 +1183,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Validates the locked IP, throwing an exeption if the locked IP is null or the locked IP is not in 'Free' state. |      * Validates the locked IP, throwing an exception if the locked IP is null or the locked IP is not in 'Free' state. | ||||||
|      */ |      */ | ||||||
|     protected void validateLockedRequestedIp(IPAddressVO ipVO, IPAddressVO lockedIpVO) { |     protected void validateLockedRequestedIp(IPAddressVO ipVO, IPAddressVO lockedIpVO) { | ||||||
|         if (lockedIpVO == null) { |         if (lockedIpVO == null) { | ||||||
| @ -1605,7 +1605,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra | |||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (s_logger.isDebugEnabled()) { |                 if (s_logger.isDebugEnabled()) { | ||||||
|                     s_logger.debug("Asking " + element.getName() + " to implemenet " + network); |                     s_logger.debug("Asking " + element.getName() + " to implement " + network); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (!element.implement(network, offering, dest, context)) { |                 if (!element.implement(network, offering, dest, context)) { | ||||||
| @ -2498,7 +2498,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra | |||||||
| 
 | 
 | ||||||
|         //remove the secondary ip addresses corresponding to to this nic |         //remove the secondary ip addresses corresponding to to this nic | ||||||
|         if (!removeVmSecondaryIpsOfNic(nic.getId())) { |         if (!removeVmSecondaryIpsOfNic(nic.getId())) { | ||||||
|             s_logger.debug("Removing nic " + nic.getId() + " secondary ip addreses failed"); |             s_logger.debug("Removing nic " + nic.getId() + " secondary ip addresses failed"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -34,14 +34,14 @@ public interface ExternalFirewallDeviceDao extends GenericDao<ExternalFirewallDe | |||||||
|     /** |     /** | ||||||
|      * list the firewall devices added in to this physical network of certain provider type? |      * list the firewall devices added in to this physical network of certain provider type? | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      */ |      */ | ||||||
|     List<ExternalFirewallDeviceVO> listByPhysicalNetworkAndProvider(long physicalNetworkId, String providerName); |     List<ExternalFirewallDeviceVO> listByPhysicalNetworkAndProvider(long physicalNetworkId, String providerName); | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * list the firewall devices added in to this physical network by their allocation state |      * list the firewall devices added in to this physical network by their allocation state | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      * @param allocationState firewall device allocation state |      * @param allocationState firewall device allocation state | ||||||
|      * @return list of ExternalFirewallDeviceVO for the devices in the physical network with a device allocation state |      * @return list of ExternalFirewallDeviceVO for the devices in the physical network with a device allocation state | ||||||
|      */ |      */ | ||||||
| @ -50,7 +50,7 @@ public interface ExternalFirewallDeviceDao extends GenericDao<ExternalFirewallDe | |||||||
|     /** |     /** | ||||||
|      * list the load balancer devices added in to this physical network by the device status (enabled/disabled) |      * list the load balancer devices added in to this physical network by the device status (enabled/disabled) | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      * @param state firewall device status |      * @param state firewall device status | ||||||
|      * @return list of ExternalFirewallDeviceVO for the devices in the physical network with a device state |      * @return list of ExternalFirewallDeviceVO for the devices in the physical network with a device state | ||||||
|      */ |      */ | ||||||
|  | |||||||
| @ -34,14 +34,14 @@ public interface ExternalLoadBalancerDeviceDao extends GenericDao<ExternalLoadBa | |||||||
|     /** |     /** | ||||||
|      * list the load balancer devices added in to this physical network of certain provider type? |      * list the load balancer devices added in to this physical network of certain provider type? | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      */ |      */ | ||||||
|     List<ExternalLoadBalancerDeviceVO> listByPhysicalNetworkAndProvider(long physicalNetworkId, String providerName); |     List<ExternalLoadBalancerDeviceVO> listByPhysicalNetworkAndProvider(long physicalNetworkId, String providerName); | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * list the load balancer devices added in to this physical network by their allocation state |      * list the load balancer devices added in to this physical network by their allocation state | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      * @param allocationState load balancer device allocation state |      * @param allocationState load balancer device allocation state | ||||||
|      * @return list of ExternalLoadBalancerDeviceVO for the devices in the physical network with a device allocation state |      * @return list of ExternalLoadBalancerDeviceVO for the devices in the physical network with a device allocation state | ||||||
|      */ |      */ | ||||||
| @ -50,7 +50,7 @@ public interface ExternalLoadBalancerDeviceDao extends GenericDao<ExternalLoadBa | |||||||
|     /** |     /** | ||||||
|      * list the load balancer devices added in to this physical network by the device status (enabled/disabled) |      * list the load balancer devices added in to this physical network by the device status (enabled/disabled) | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      * @param state load balancer device status |      * @param state load balancer device status | ||||||
|      * @return list of ExternalLoadBalancerDeviceVO for the devices in the physical network with a device state |      * @return list of ExternalLoadBalancerDeviceVO for the devices in the physical network with a device state | ||||||
|      */ |      */ | ||||||
| @ -59,7 +59,7 @@ public interface ExternalLoadBalancerDeviceDao extends GenericDao<ExternalLoadBa | |||||||
|     /** |     /** | ||||||
|      * list the load balancer devices added in to this physical network by the managed type (external/cloudstack managed) |      * list the load balancer devices added in to this physical network by the managed type (external/cloudstack managed) | ||||||
|      * @param physicalNetworkId physical Network Id |      * @param physicalNetworkId physical Network Id | ||||||
|      * @param providerName netwrok service provider name |      * @param providerName network service provider name | ||||||
|      * @param managed managed type |      * @param managed managed type | ||||||
|      * @return list of ExternalLoadBalancerDeviceVO for the devices in to this physical network of a managed type |      * @return list of ExternalLoadBalancerDeviceVO for the devices in to this physical network of a managed type | ||||||
|      */ |      */ | ||||||
|  | |||||||
| @ -58,7 +58,7 @@ public interface IPAddressDao extends GenericDao<IPAddressVO, Long> { | |||||||
|     IPAddressVO findByAssociatedVmId(long vmId); |     IPAddressVO findByAssociatedVmId(long vmId); | ||||||
| 
 | 
 | ||||||
|     // for vm secondary ips case mapping is  IP1--> vmIp1, IP2-->vmIp2, etc |     // for vm secondary ips case mapping is  IP1--> vmIp1, IP2-->vmIp2, etc | ||||||
|     // This method is used when one vm is mapped to muliple to public ips |     // This method is used when one vm is mapped to multiple to public ips | ||||||
|     List<IPAddressVO> findAllByAssociatedVmId(long vmId); |     List<IPAddressVO> findAllByAssociatedVmId(long vmId); | ||||||
| 
 | 
 | ||||||
|     IPAddressVO findByIpAndSourceNetworkId(long networkId, String ipAddress); |     IPAddressVO findByIpAndSourceNetworkId(long networkId, String ipAddress); | ||||||
|  | |||||||
| @ -304,7 +304,7 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     // for vm secondary ips case mapping is  IP1--> vmIp1, IP2-->vmIp2, etc |     // for vm secondary ips case mapping is  IP1--> vmIp1, IP2-->vmIp2, etc | ||||||
|     // Used when vm is mapped to muliple to public ips |     // Used when vm is mapped to multiple to public ips | ||||||
|     @Override |     @Override | ||||||
|     public List<IPAddressVO> findAllByAssociatedVmId(long vmId) { |     public List<IPAddressVO> findAllByAssociatedVmId(long vmId) { | ||||||
|         SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create(); |         SearchCriteria<IPAddressVO> sc = AllFieldsSearch.create(); | ||||||
|  | |||||||
| @ -1884,7 +1884,7 @@ public class Upgrade410to420 implements DbUpgrade { | |||||||
|             //Update all snapshots except KVM snapshots |             //Update all snapshots except KVM snapshots | ||||||
|             int rowCount = snapshotStoreInsert.executeUpdate(); |             int rowCount = snapshotStoreInsert.executeUpdate(); | ||||||
|             s_logger.debug("Inserted " + rowCount + " snapshots into snapshot_store_ref"); |             s_logger.debug("Inserted " + rowCount + " snapshots into snapshot_store_ref"); | ||||||
|             //backsnap_id for KVM snapshots is complate path. CONCAT is not required |             //backsnap_id for KVM snapshots is complete path. CONCAT is not required | ||||||
|             try(PreparedStatement snapshotStoreInsert_2 = |             try(PreparedStatement snapshotStoreInsert_2 = | ||||||
|                     conn.prepareStatement("INSERT INTO `cloud`.`snapshot_store_ref` (store_id,  snapshot_id, created, size, parent_snapshot_id, install_path, volume_id, update_count, ref_cnt, store_role, state) select sechost_id, id, created, size, prev_snap_id, backup_snap_id, volume_id, 0, 0, 'Image', 'Ready' from `cloud`.`snapshots` where status = 'BackedUp' and hypervisor_type = 'KVM' and sechost_id is not null and removed is null");) { |                     conn.prepareStatement("INSERT INTO `cloud`.`snapshot_store_ref` (store_id,  snapshot_id, created, size, parent_snapshot_id, install_path, volume_id, update_count, ref_cnt, store_role, state) select sechost_id, id, created, size, prev_snap_id, backup_snap_id, volume_id, 0, 0, 'Image', 'Ready' from `cloud`.`snapshots` where status = 'BackedUp' and hypervisor_type = 'KVM' and sechost_id is not null and removed is null");) { | ||||||
|                 rowCount = snapshotStoreInsert_2.executeUpdate(); |                 rowCount = snapshotStoreInsert_2.executeUpdate(); | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im | |||||||
|     private static final Logger s_logger = Logger.getLogger(ConsoleProxyDaoImpl.class); |     private static final Logger s_logger = Logger.getLogger(ConsoleProxyDaoImpl.class); | ||||||
| 
 | 
 | ||||||
|     // |     // | ||||||
|     // query SQL for returnning console proxy assignment info as following |     // query SQL for returning console proxy assignment info as following | ||||||
|     //         proxy vm id, count of assignment |     //         proxy vm id, count of assignment | ||||||
|     // |     // | ||||||
|     private static final String PROXY_ASSIGNMENT_MATRIX = "SELECT c.id, count(runningVm.id) AS count " |     private static final String PROXY_ASSIGNMENT_MATRIX = "SELECT c.id, count(runningVm.id) AS count " | ||||||
| @ -63,7 +63,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im | |||||||
|         + " WHERE v.type='ConsoleProxy' AND (v.state='Creating' OR v.state='Starting' OR v.state='Running' OR v.state='Migrating')" + " GROUP BY d.id, d.name"; |         + " WHERE v.type='ConsoleProxy' AND (v.state='Creating' OR v.state='Starting' OR v.state='Running' OR v.state='Migrating')" + " GROUP BY d.id, d.name"; | ||||||
| 
 | 
 | ||||||
|     // |     // | ||||||
|     // query SQL for returnning running console proxy count at data center basis |     // query SQL for returning running console proxy count at data center basis | ||||||
|     // |     // | ||||||
|     private static final String DATACENTER_PROXY_MATRIX = |     private static final String DATACENTER_PROXY_MATRIX = | ||||||
|         "SELECT d.id, d.name, count(dcid) as count" |         "SELECT d.id, d.name, count(dcid) as count" | ||||||
|  | |||||||
| @ -448,7 +448,7 @@ CREATE VIEW `cloud`.`template_view` AS | |||||||
| 
 | 
 | ||||||
| UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC,Hyperv' WHERE name='hypervisor.list'; | UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC,Hyperv' WHERE name='hypervisor.list'; | ||||||
| UPDATE `cloud`.`configuration` SET description="If set to true, will set guest VM's name as it appears on the hypervisor, to its hostname. The flag is supported for VMware hypervisor only" WHERE name='vm.instancename.flag'; | UPDATE `cloud`.`configuration` SET description="If set to true, will set guest VM's name as it appears on the hypervisor, to its hostname. The flag is supported for VMware hypervisor only" WHERE name='vm.instancename.flag'; | ||||||
| INSERT IGNORE INTO `cloud`.`configuration`(category, instance, component, name, value, description, default_value) VALUES ('Advanced', 'DEFAULT', 'management-server', 'implicit.host.tags', 'GPU', 'Tag hosts at the time of host disovery based on the host properties/capabilities ', 'GPU'); | INSERT IGNORE INTO `cloud`.`configuration`(category, instance, component, name, value, description, default_value) VALUES ('Advanced', 'DEFAULT', 'management-server', 'implicit.host.tags', 'GPU', 'Tag hosts at the time of host discovery based on the host properties/capabilities ', 'GPU'); | ||||||
| 
 | 
 | ||||||
| DROP VIEW IF EXISTS `cloud`.`domain_router_view`; | DROP VIEW IF EXISTS `cloud`.`domain_router_view`; | ||||||
| CREATE VIEW `cloud`.`domain_router_view` AS | CREATE VIEW `cloud`.`domain_router_view` AS | ||||||
|  | |||||||
| @ -253,11 +253,11 @@ public class StorageCacheManagerImpl implements StorageCacheManager, Manager { | |||||||
|             if (obj != null) { |             if (obj != null) { | ||||||
|                 State st = obj.getState(); |                 State st = obj.getState(); | ||||||
| 
 | 
 | ||||||
|                 long miliSeconds = 10000; |                 long milliSeconds = 10000; | ||||||
|                 long timeoutSeconds = 3600; |                 long timeoutSeconds = 3600; | ||||||
|                 long timeoutMiliSeconds = timeoutSeconds * 1000; |                 long timeoutMilliSeconds = timeoutSeconds * 1000; | ||||||
|                 Date now = new Date(); |                 Date now = new Date(); | ||||||
|                 long expiredEpoch = now.getTime() + timeoutMiliSeconds; |                 long expiredEpoch = now.getTime() + timeoutMilliSeconds; | ||||||
|                 Date expiredDate = new Date(expiredEpoch); |                 Date expiredDate = new Date(expiredEpoch); | ||||||
| 
 | 
 | ||||||
|                 /* |                 /* | ||||||
| @ -273,7 +273,7 @@ public class StorageCacheManagerImpl implements StorageCacheManager, Manager { | |||||||
|                      */ |                      */ | ||||||
|                     s_logger.debug("waiting cache copy completion type: " + typeName + ", id: " + obj.getObjectId() + ", lock: " + lock.hashCode()); |                     s_logger.debug("waiting cache copy completion type: " + typeName + ", id: " + obj.getObjectId() + ", lock: " + lock.hashCode()); | ||||||
|                     try { |                     try { | ||||||
|                         lock.wait(miliSeconds); |                         lock.wait(milliSeconds); | ||||||
|                     } catch (InterruptedException e) { |                     } catch (InterruptedException e) { | ||||||
|                         s_logger.debug("[ignored] interrupted while waiting for cache copy completion."); |                         s_logger.debug("[ignored] interrupted while waiting for cache copy completion."); | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -177,7 +177,7 @@ public class StorageVMSnapshotStrategy extends DefaultVMSnapshotStrategy { | |||||||
|                         thawAnswer = (FreezeThawVMAnswer) agentMgr.send(hostId, thawCmd); |                         thawAnswer = (FreezeThawVMAnswer) agentMgr.send(hostId, thawCmd); | ||||||
|                         throw new CloudRuntimeException("Could not take snapshot for volume with id=" + vol.getId()); |                         throw new CloudRuntimeException("Could not take snapshot for volume with id=" + vol.getId()); | ||||||
|                     } |                     } | ||||||
|                     s_logger.info(String.format("Snapshot with id=%s, took  %s miliseconds", snapInfo.getId(), |                     s_logger.info(String.format("Snapshot with id=%s, took  %s milliseconds", snapInfo.getId(), | ||||||
|                             TimeUnit.MILLISECONDS.convert(elapsedTime(startSnapshtot), TimeUnit.NANOSECONDS))); |                             TimeUnit.MILLISECONDS.convert(elapsedTime(startSnapshtot), TimeUnit.NANOSECONDS))); | ||||||
|                 } |                 } | ||||||
|                 answer = new CreateVMSnapshotAnswer(ccmd, true, ""); |                 answer = new CreateVMSnapshotAnswer(ccmd, true, ""); | ||||||
| @ -185,7 +185,7 @@ public class StorageVMSnapshotStrategy extends DefaultVMSnapshotStrategy { | |||||||
|                 thawAnswer = (FreezeThawVMAnswer) agentMgr.send(hostId, thawCmd); |                 thawAnswer = (FreezeThawVMAnswer) agentMgr.send(hostId, thawCmd); | ||||||
|                 if (thawAnswer != null && thawAnswer.getResult()) { |                 if (thawAnswer != null && thawAnswer.getResult()) { | ||||||
|                     s_logger.info(String.format( |                     s_logger.info(String.format( | ||||||
|                             "Virtual machne is thawed. The freeze of virtual machine took %s miliseconds.", |                             "Virtual machne is thawed. The freeze of virtual machine took %s milliseconds.", | ||||||
|                             TimeUnit.MILLISECONDS.convert(elapsedTime(startFreeze), TimeUnit.NANOSECONDS))); |                             TimeUnit.MILLISECONDS.convert(elapsedTime(startFreeze), TimeUnit.NANOSECONDS))); | ||||||
|                 } |                 } | ||||||
|             } else { |             } else { | ||||||
| @ -219,7 +219,7 @@ public class StorageVMSnapshotStrategy extends DefaultVMSnapshotStrategy { | |||||||
|             throw new CloudRuntimeException(e.getMessage()); |             throw new CloudRuntimeException(e.getMessage()); | ||||||
|         } finally { |         } finally { | ||||||
|             if (thawAnswer == null && freezeAnswer != null) { |             if (thawAnswer == null && freezeAnswer != null) { | ||||||
|                 s_logger.info(String.format("Freeze of virtual machine took %s miliseconds.", TimeUnit.MILLISECONDS |                 s_logger.info(String.format("Freeze of virtual machine took %s milliseconds.", TimeUnit.MILLISECONDS | ||||||
|                                                 .convert(elapsedTime(startFreeze), TimeUnit.NANOSECONDS))); |                                                 .convert(elapsedTime(startFreeze), TimeUnit.NANOSECONDS))); | ||||||
|                 try { |                 try { | ||||||
|                     thawAnswer = (FreezeThawVMAnswer) agentMgr.send(hostId, thawCmd); |                     thawAnswer = (FreezeThawVMAnswer) agentMgr.send(hostId, thawCmd); | ||||||
|  | |||||||
| @ -31,15 +31,15 @@ public class MessageDetector implements MessageSubscriber { | |||||||
|         _subjects = null; |         _subjects = null; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void waitAny(long timeoutInMiliseconds) { |     public void waitAny(long timeoutInMilliseconds) { | ||||||
|         if (timeoutInMiliseconds < 100) { |         if (timeoutInMilliseconds < 100) { | ||||||
|             s_logger.warn("waitAny is passed with a too short time-out interval. " + timeoutInMiliseconds + "ms"); |             s_logger.warn("waitAny is passed with a too short time-out interval. " + timeoutInMilliseconds + "ms"); | ||||||
|             timeoutInMiliseconds = 100; |             timeoutInMilliseconds = 100; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         synchronized (this) { |         synchronized (this) { | ||||||
|             try { |             try { | ||||||
|                 wait(timeoutInMiliseconds); |                 wait(timeoutInMilliseconds); | ||||||
|             } catch (InterruptedException e) { |             } catch (InterruptedException e) { | ||||||
|                 s_logger.debug("[ignored] interrupted while waiting on any message."); |                 s_logger.debug("[ignored] interrupted while waiting on any message."); | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -117,12 +117,12 @@ public interface AsyncJobManager extends Manager { | |||||||
|      * |      * | ||||||
|      * @param wakupTopicsOnMessageBus topic on message bus to wakeup the wait |      * @param wakupTopicsOnMessageBus topic on message bus to wakeup the wait | ||||||
|      * @param checkIntervalInMilliSeconds time to break out wait for checking predicate condition |      * @param checkIntervalInMilliSeconds time to break out wait for checking predicate condition | ||||||
|      * @param timeoutInMiliseconds time out to break out the whole wait process |      * @param timeoutInMilliseconds time out to break out the whole wait process | ||||||
|      * @param predicate |      * @param predicate | ||||||
|      * @return true, predicate condition is satisfied |      * @return true, predicate condition is satisfied | ||||||
|      *             false, wait is timed out |      *             false, wait is timed out | ||||||
|      */ |      */ | ||||||
|     boolean waitAndCheck(AsyncJob job, String[] wakupTopicsOnMessageBus, long checkIntervalInMilliSeconds, long timeoutInMiliseconds, Predicate predicate); |     boolean waitAndCheck(AsyncJob job, String[] wakupTopicsOnMessageBus, long checkIntervalInMilliSeconds, long timeoutInMilliseconds, Predicate predicate); | ||||||
| 
 | 
 | ||||||
|     AsyncJob queryJob(long jobId, boolean updatePollTime); |     AsyncJob queryJob(long jobId, boolean updatePollTime); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -758,7 +758,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public boolean waitAndCheck(AsyncJob job, String[] wakeupTopicsOnMessageBus, long checkIntervalInMilliSeconds, long timeoutInMiliseconds, Predicate predicate) { |     public boolean waitAndCheck(AsyncJob job, String[] wakeupTopicsOnMessageBus, long checkIntervalInMilliSeconds, long timeoutInMilliseconds, Predicate predicate) { | ||||||
| 
 | 
 | ||||||
|         MessageDetector msgDetector = new MessageDetector(); |         MessageDetector msgDetector = new MessageDetector(); | ||||||
|         String[] topics = Arrays.copyOf(wakeupTopicsOnMessageBus, wakeupTopicsOnMessageBus.length + 1); |         String[] topics = Arrays.copyOf(wakeupTopicsOnMessageBus, wakeupTopicsOnMessageBus.length + 1); | ||||||
| @ -767,7 +767,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, | |||||||
|         msgDetector.open(_messageBus, topics); |         msgDetector.open(_messageBus, topics); | ||||||
|         try { |         try { | ||||||
|             long startTick = System.currentTimeMillis(); |             long startTick = System.currentTimeMillis(); | ||||||
|             while (timeoutInMiliseconds < 0 || System.currentTimeMillis() - startTick < timeoutInMiliseconds) { |             while (timeoutInMilliseconds < 0 || System.currentTimeMillis() - startTick < timeoutInMilliseconds) { | ||||||
|                 msgDetector.waitAny(checkIntervalInMilliSeconds); |                 msgDetector.waitAny(checkIntervalInMilliSeconds); | ||||||
|                 job = _jobDao.findById(job.getId()); |                 job = _jobDao.findById(job.getId()); | ||||||
|                 if (job != null && job.getStatus().done()) { |                 if (job != null && job.getStatus().done()) { | ||||||
|  | |||||||
| @ -198,7 +198,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //Fang: new command added; |     //Fang: new command added; | ||||||
|     // Important! we need to sync file system before we can safely use tar to work around a linux kernal bug(or feature) |     // Important! we need to sync file system before we can safely use tar to work around a linux kernel bug(or feature) | ||||||
|     public String createOvaForVolume(VolumeObjectTO volume, int archiveTimeout) { |     public String createOvaForVolume(VolumeObjectTO volume, int archiveTimeout) { | ||||||
|         DataStoreTO storeTO = volume.getDataStore(); |         DataStoreTO storeTO = volume.getDataStore(); | ||||||
|         if (!(storeTO instanceof NfsTO)) { |         if (!(storeTO instanceof NfsTO)) { | ||||||
| @ -1054,7 +1054,7 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager { | |||||||
|             } |             } | ||||||
|             String exportDir = ova_metafile.getParent(); |             String exportDir = ova_metafile.getParent(); | ||||||
|             s_logger.info("exportDir: " + exportDir); |             s_logger.info("exportDir: " + exportDir); | ||||||
|             // Important! we need to sync file system before we can safely use tar to work around a linux kernal bug(or feature) |             // Important! we need to sync file system before we can safely use tar to work around a linux kernel bug(or feature) | ||||||
|             s_logger.info("Sync file system before we package OVA..., before tar "); |             s_logger.info("Sync file system before we package OVA..., before tar "); | ||||||
|             s_logger.info("ova: " + ovaFileName + ", ovf:" + ovfFileName + ", vmdk:" + disks[0] + "."); |             s_logger.info("ova: " + ovaFileName + ", ovf:" + ovfFileName + ", vmdk:" + disks[0] + "."); | ||||||
|             Script commandSync = new Script(true, "sync", 0, s_logger); |             Script commandSync = new Script(true, "sync", 0, s_logger); | ||||||
|  | |||||||
| @ -99,7 +99,7 @@ public class CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void testGetPathFilesExeption() { |     public void testGetPathFilesException() { | ||||||
|         String patch = citrixResourceBase.getPatchFilePath(); |         String patch = citrixResourceBase.getPatchFilePath(); | ||||||
| 
 | 
 | ||||||
|         PowerMockito.mockStatic(Script.class); |         PowerMockito.mockStatic(Script.class); | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class XcpOssResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -46,8 +46,8 @@ public class XcpServerResourceTest extends CitrixResourceBaseTest { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFilesExeption() { |     public void testGetFilesException() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class XenServer56FP1ResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -47,7 +47,7 @@ public class XenServer56ResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class XenServer56SP2ResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class XenServer600ResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class XenServer625ResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -43,7 +43,7 @@ public class XenServer650ResourceTest extends CitrixResourceBaseTest { | |||||||
| 
 | 
 | ||||||
|     @Test(expected = CloudRuntimeException.class) |     @Test(expected = CloudRuntimeException.class) | ||||||
|     public void testGetFiles() { |     public void testGetFiles() { | ||||||
|         testGetPathFilesExeption(); |         testGetPathFilesException(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     @Test |     @Test | ||||||
|  | |||||||
| @ -49,7 +49,7 @@ fi | |||||||
| KS_PASS=$(sed -n '/keystore.passphrase/p' "$PROPS_FILE" 2>/dev/null  | sed 's/keystore.passphrase=//g' 2>/dev/null) | KS_PASS=$(sed -n '/keystore.passphrase/p' "$PROPS_FILE" 2>/dev/null  | sed 's/keystore.passphrase=//g' 2>/dev/null) | ||||||
| 
 | 
 | ||||||
| if [ -z "${KS_PASS// }" ]; then | if [ -z "${KS_PASS// }" ]; then | ||||||
|     echo "Failed to find keystore passphrase from file: $PROPS_FILE, quiting!" |     echo "Failed to find keystore passphrase from file: $PROPS_FILE, quitting!" | ||||||
|     exit 1 |     exit 1 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -844,7 +844,7 @@ public enum Config { | |||||||
|             "The interval (in milliseconds) when vm stats are retrieved from agents.", |             "The interval (in milliseconds) when vm stats are retrieved from agents.", | ||||||
|             null), |             null), | ||||||
|     VmDiskStatsInterval("Advanced", ManagementServer.class, Integer.class, "vm.disk.stats.interval", "0", "Interval (in seconds) to report vm disk statistics.", null), |     VmDiskStatsInterval("Advanced", ManagementServer.class, Integer.class, "vm.disk.stats.interval", "0", "Interval (in seconds) to report vm disk statistics.", null), | ||||||
|     VolumeStatsInterval("Advanced", ManagementServer.class, Integer.class, "volume.stats.interval", "60000", "Interval (in miliseconds) to report volume statistics.", null), |     VolumeStatsInterval("Advanced", ManagementServer.class, Integer.class, "volume.stats.interval", "60000", "Interval (in milliseconds) to report volume statistics.", null), | ||||||
|     VmTransitionWaitInterval( |     VmTransitionWaitInterval( | ||||||
|             "Advanced", |             "Advanced", | ||||||
|             ManagementServer.class, |             ManagementServer.class, | ||||||
| @ -1621,7 +1621,7 @@ public enum Config { | |||||||
|             String.class, |             String.class, | ||||||
|             "implicit.host.tags", |             "implicit.host.tags", | ||||||
|             "GPU", |             "GPU", | ||||||
|             "Tag hosts at the time of host disovery based on the host properties/capabilities", |             "Tag hosts at the time of host discovery based on the host properties/capabilities", | ||||||
|             null), |             null), | ||||||
|     VpcCleanupInterval( |     VpcCleanupInterval( | ||||||
|             "Advanced", |             "Advanced", | ||||||
|  | |||||||
| @ -4087,7 +4087,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C | |||||||
|         for (String vlanRange : listOfRanges) { |         for (String vlanRange : listOfRanges) { | ||||||
|             String[] VnetRange = vlanRange.split("-"); |             String[] VnetRange = vlanRange.split("-"); | ||||||
| 
 | 
 | ||||||
|             // Init with [min,max] of VLAN. Actually 0x000 and 0xFFF are reserved by IEEE, shoudn't be used. |             // Init with [min,max] of VLAN. Actually 0x000 and 0xFFF are reserved by IEEE, shouldn't be used. | ||||||
|             long minVnet = MIN_VLAN_ID; |             long minVnet = MIN_VLAN_ID; | ||||||
|             long maxVnet = MAX_VLAN_ID; |             long maxVnet = MAX_VLAN_ID; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -198,8 +198,8 @@ public class MockServer implements Runnable { | |||||||
|         return shutdowned; |         return shutdowned; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public void waitUntilShutdowned(long timeToWaitMiliseconds) throws InterruptedException { |     public void waitUntilShutdowned(long timeToWaitMilliseconds) throws InterruptedException { | ||||||
|         long deadline = System.currentTimeMillis() + timeToWaitMiliseconds; |         long deadline = System.currentTimeMillis() + timeToWaitMilliseconds; | ||||||
|         while (!shutdowned && System.currentTimeMillis() < deadline) { |         while (!shutdowned && System.currentTimeMillis() < deadline) { | ||||||
|             Thread.sleep(10); |             Thread.sleep(10); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -576,7 +576,7 @@ class TestSystemVmLocalStorage(cloudstackTestCase): | |||||||
|             ispersistent='true' |             ispersistent='true' | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         # 3-list netwrok offerings |         # 3-list network offerings | ||||||
|         list_nw_of = NetworkOffering.list(self.apiclient, |         list_nw_of = NetworkOffering.list(self.apiclient, | ||||||
|                                           id=self.network_offering.id) |                                           id=self.network_offering.id) | ||||||
|         self.assertEqual( |         self.assertEqual( | ||||||
|  | |||||||
| @ -721,7 +721,7 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase): | |||||||
| 
 | 
 | ||||||
|         self.debug("Created network %s" % network_2.name) |         self.debug("Created network %s" % network_2.name) | ||||||
| 
 | 
 | ||||||
|         self.debug("Trying to add netwrok %s to VM %s, this should fail" % |         self.debug("Trying to add network %s to VM %s, this should fail" % | ||||||
|                    (network_2.name, virtual_machine.id)) |                    (network_2.name, virtual_machine.id)) | ||||||
| 
 | 
 | ||||||
|         with self.assertRaises(Exception) as e: |         with self.assertRaises(Exception) as e: | ||||||
|  | |||||||
| @ -4194,7 +4194,7 @@ class TestInstances(cloudstackTestCase): | |||||||
|             "Isolated Network Offerings with sourceNat enabled are not found" |             "Isolated Network Offerings with sourceNat enabled are not found" | ||||||
|         ) |         ) | ||||||
|         """ |         """ | ||||||
|         Create Isolated netwrok with ip range |         Create Isolated network with ip range | ||||||
|         """ |         """ | ||||||
|         self.services["network"]["startip"] = "10.1.1.2" |         self.services["network"]["startip"] = "10.1.1.2" | ||||||
|         self.services["network"]["endip"] = "10.1.1.254" |         self.services["network"]["endip"] = "10.1.1.254" | ||||||
| @ -4312,7 +4312,7 @@ class TestInstances(cloudstackTestCase): | |||||||
|             "Isolated Network Offerings with sourceNat enabled are not found" |             "Isolated Network Offerings with sourceNat enabled are not found" | ||||||
|         ) |         ) | ||||||
|         """ |         """ | ||||||
|         Create Isolated netwrok with ip range |         Create Isolated network with ip range | ||||||
|         """ |         """ | ||||||
|         self.services["network"]["startip"] = "10.1.1.2" |         self.services["network"]["startip"] = "10.1.1.2" | ||||||
|         self.services["network"]["endip"] = "10.1.1.254" |         self.services["network"]["endip"] = "10.1.1.254" | ||||||
|  | |||||||
| @ -340,7 +340,7 @@ class TestBasicOperations(cloudstackTestCase): | |||||||
|                 self.apiclient, id=( |                 self.apiclient, id=( | ||||||
|                     virtual_machine.nic[0].id + random_gen())) |                     virtual_machine.nic[0].id + random_gen())) | ||||||
|             self.fail( |             self.fail( | ||||||
|                 "Adding secondary IP with wrong NIC id succeeded, it shoud have failed") |                 "Adding secondary IP with wrong NIC id succeeded, it should have failed") | ||||||
|         except Exception as e: |         except Exception as e: | ||||||
|             self.debug("Failed while adding secondary IP to wrong NIC") |             self.debug("Failed while adding secondary IP to wrong NIC") | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -52,11 +52,11 @@ import logging | |||||||
| import random | import random | ||||||
| import time | import time | ||||||
| 
 | 
 | ||||||
| class TestMulipleNicSupport(cloudstackTestCase): | class TestMultipleNicSupport(cloudstackTestCase): | ||||||
|     @classmethod |     @classmethod | ||||||
|     def setUpClass(cls): |     def setUpClass(cls): | ||||||
|         cls.testClient = super( |         cls.testClient = super( | ||||||
|             TestMulipleNicSupport, |             TestMultipleNicSupport, | ||||||
|             cls).getClsTestClient() |             cls).getClsTestClient() | ||||||
|         cls.apiclient = cls.testClient.getApiClient() |         cls.apiclient = cls.testClient.getApiClient() | ||||||
|         cls.testdata = cls.testClient.getParsedTestDataConfig() |         cls.testdata = cls.testClient.getParsedTestDataConfig() | ||||||
| @ -70,7 +70,7 @@ class TestMulipleNicSupport(cloudstackTestCase): | |||||||
|             cls.skip = True |             cls.skip = True | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|         cls.logger = logging.getLogger("TestMulipleNicSupport") |         cls.logger = logging.getLogger("TestMultipleNicSupport") | ||||||
|         cls.stream_handler = logging.StreamHandler() |         cls.stream_handler = logging.StreamHandler() | ||||||
|         cls.logger.setLevel(logging.DEBUG) |         cls.logger.setLevel(logging.DEBUG) | ||||||
|         cls.logger.addHandler(cls.stream_handler) |         cls.logger.addHandler(cls.stream_handler) | ||||||
| @ -255,7 +255,7 @@ class TestMulipleNicSupport(cloudstackTestCase): | |||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
|     def tearDownClass(self): |     def tearDownClass(self): | ||||||
|         super(TestMulipleNicSupport, self).tearDownClass() |         super(TestMultipleNicSupport, self).tearDownClass() | ||||||
| 
 | 
 | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         if self.skip: |         if self.skip: | ||||||
| @ -265,7 +265,7 @@ class TestMulipleNicSupport(cloudstackTestCase): | |||||||
|         return |         return | ||||||
| 
 | 
 | ||||||
|     def tearDown(self): |     def tearDown(self): | ||||||
|         super(TestMulipleNicSupport, self).tearDown() |         super(TestMultipleNicSupport, self).tearDown() | ||||||
| 
 | 
 | ||||||
|     def verify_network_rules(self, vm_id): |     def verify_network_rules(self, vm_id): | ||||||
|         virtual_machine = VirtualMachine.list( |         virtual_machine = VirtualMachine.list( | ||||||
|  | |||||||
| @ -39,11 +39,11 @@ from marvin.lib.common import (get_domain, | |||||||
| 
 | 
 | ||||||
| import logging | import logging | ||||||
| 
 | 
 | ||||||
| class TestMulipleNetworkCreation(cloudstackTestCase): | class TestMultipleNetworkCreation(cloudstackTestCase): | ||||||
|     @classmethod |     @classmethod | ||||||
|     def setUpClass(cls): |     def setUpClass(cls): | ||||||
|         cls.testClient = super( |         cls.testClient = super( | ||||||
|             TestMulipleNetworkCreation, |             TestMultipleNetworkCreation, | ||||||
|             cls).getClsTestClient() |             cls).getClsTestClient() | ||||||
|         cls.apiclient = cls.testClient.getApiClient() |         cls.apiclient = cls.testClient.getApiClient() | ||||||
|         cls.testdata = cls.testClient.getParsedTestDataConfig() |         cls.testdata = cls.testClient.getParsedTestDataConfig() | ||||||
| @ -54,7 +54,7 @@ class TestMulipleNetworkCreation(cloudstackTestCase): | |||||||
|         cls.template = get_template(cls.apiclient, cls.zone.id) |         cls.template = get_template(cls.apiclient, cls.zone.id) | ||||||
|         cls._cleanup = [] |         cls._cleanup = [] | ||||||
| 
 | 
 | ||||||
|         cls.logger = logging.getLogger("TestMulipleNetworkCreation") |         cls.logger = logging.getLogger("TestMultipleNetworkCreation") | ||||||
|         cls.stream_handler = logging.StreamHandler() |         cls.stream_handler = logging.StreamHandler() | ||||||
|         cls.logger.setLevel(logging.DEBUG) |         cls.logger.setLevel(logging.DEBUG) | ||||||
|         cls.logger.addHandler(cls.stream_handler) |         cls.logger.addHandler(cls.stream_handler) | ||||||
| @ -127,7 +127,7 @@ class TestMulipleNetworkCreation(cloudstackTestCase): | |||||||
|                 allocationstate="Enabled" |                 allocationstate="Enabled" | ||||||
|             ) |             ) | ||||||
|             # Cleanup resources used |             # Cleanup resources used | ||||||
|             super(TestMulipleNetworkCreation, cls).tearDownClass() |             super(TestMultipleNetworkCreation, cls).tearDownClass() | ||||||
|         except Exception as e: |         except Exception as e: | ||||||
|             raise Exception("Warning: Exception during cleanup : %s" % e) |             raise Exception("Warning: Exception during cleanup : %s" % e) | ||||||
|         return |         return | ||||||
| @ -139,7 +139,7 @@ class TestMulipleNetworkCreation(cloudstackTestCase): | |||||||
|         return |         return | ||||||
| 
 | 
 | ||||||
|     def tearDown(self): |     def tearDown(self): | ||||||
|         super(TestMulipleNetworkCreation, self).tearDown() |         super(TestMultipleNetworkCreation, self).tearDown() | ||||||
| 
 | 
 | ||||||
|     @attr(tags=["advanced"], required_hardware="false") |     @attr(tags=["advanced"], required_hardware="false") | ||||||
|     def test_01_add_traffictype_for_untagged_networks(self): |     def test_01_add_traffictype_for_untagged_networks(self): | ||||||
|  | |||||||
| @ -490,7 +490,7 @@ class TestRegionVpcOffering(cloudstackTestCase): | |||||||
|                                   vpcid=vpc.id |                                   vpcid=vpc.id | ||||||
|                                   ) |                                   ) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make PF and LB accessible") |         self.debug("Adding NetworkACl rules to make PF and LB accessible") | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|                 self.apiclient, |                 self.apiclient, | ||||||
|                 networkid=network.id, |                 networkid=network.id, | ||||||
|  | |||||||
| @ -584,7 +584,7 @@ class TestSharedNetworks(cloudstackTestCase): | |||||||
|         #  6. No checks reqd |         #  6. No checks reqd | ||||||
|         #  7. a. listVirtualMachines should show both VMs in running state |         #  7. a. listVirtualMachines should show both VMs in running state | ||||||
|         #     in the user account and the admin account |         #     in the user account and the admin account | ||||||
|         #     b. VM's IPs shoud be in the range of the shared network ip ranges |         #     b. VM's IPs should be in the range of the shared network ip ranges | ||||||
| 
 | 
 | ||||||
|         # Create admin account |         # Create admin account | ||||||
|         self.admin_account = Account.create( |         self.admin_account = Account.create( | ||||||
| @ -1974,7 +1974,7 @@ class TestSharedNetworks(cloudstackTestCase): | |||||||
|         #     enabled offering |         #     enabled offering | ||||||
|         #  4. listPhysicalNetworks should return at least one active |         #  4. listPhysicalNetworks should return at least one active | ||||||
|         #     physical network |         #     physical network | ||||||
|         #  5. network creation shoud PASS |         #  5. network creation should PASS | ||||||
|         #  6. network creation should FAIL since VLAN is already used by |         #  6. network creation should FAIL since VLAN is already used by | ||||||
|         #     previously created network |         #     previously created network | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1004,7 +1004,7 @@ class TestVPC(cloudstackTestCase): | |||||||
|             vpcid=vpc.id |             vpcid=vpc.id | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make NAT rule accessible") |         self.debug("Adding NetworkACl rules to make NAT rule accessible") | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network_1.id, |             networkid=network_1.id, | ||||||
| @ -1090,7 +1090,7 @@ class TestVPC(cloudstackTestCase): | |||||||
|             vm_3.name, vm_4.name)) |             vm_3.name, vm_4.name)) | ||||||
|         lb_rule.assign(self.apiclient, [vm_3, vm_4]) |         lb_rule.assign(self.apiclient, [vm_3, vm_4]) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make PF and LB accessible") |         self.debug("Adding NetworkACl rules to make PF and LB accessible") | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network_2.id, |             networkid=network_2.id, | ||||||
| @ -1350,7 +1350,7 @@ class TestVPC(cloudstackTestCase): | |||||||
|             vpcid=vpc.id |             vpcid=vpc.id | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make NAT rule accessible") |         self.debug("Adding NetworkACl rules to make NAT rule accessible") | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network_1.id, |             networkid=network_1.id, | ||||||
| @ -1436,7 +1436,7 @@ class TestVPC(cloudstackTestCase): | |||||||
|             vm_3.name, vm_4.name)) |             vm_3.name, vm_4.name)) | ||||||
|         lb_rule.assign(self.apiclient, [vm_3, vm_4]) |         lb_rule.assign(self.apiclient, [vm_3, vm_4]) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make PF and LB accessible") |         self.debug("Adding NetworkACl rules to make PF and LB accessible") | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network_2.id, |             networkid=network_2.id, | ||||||
|  | |||||||
| @ -481,7 +481,7 @@ class TestVPCDistributedRouterOffering(cloudstackTestCase): | |||||||
|                                   vpcid=vpc.id |                                   vpcid=vpc.id | ||||||
|                                   ) |                                   ) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make PF and LB accessible") |         self.debug("Adding NetworkACl rules to make PF and LB accessible") | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|                 self.apiclient, |                 self.apiclient, | ||||||
|                 networkid=network.id, |                 networkid=network.id, | ||||||
|  | |||||||
| @ -1864,7 +1864,7 @@ class TestVPCNetworkUpgrade(cloudstackTestCase): | |||||||
|             "List public Ip for network should list the Ip addr" |             "List public Ip for network should list the Ip addr" | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make PF and LB accessible") |         self.debug("Adding NetworkACl rules to make PF and LB accessible") | ||||||
|         nw_acl = NetworkACL.create( |         nw_acl = NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network_1.id, |             networkid=network_1.id, | ||||||
| @ -2023,7 +2023,7 @@ class TestVPCNetworkUpgrade(cloudstackTestCase): | |||||||
|         ) |         ) | ||||||
|         self.cleanup.append(nat_rule) |         self.cleanup.append(nat_rule) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make NAT rule accessible") |         self.debug("Adding NetworkACl rules to make NAT rule accessible") | ||||||
|         nat_acl = NetworkACL.create( |         nat_acl = NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network_1.id, |             networkid=network_1.id, | ||||||
|  | |||||||
| @ -416,7 +416,7 @@ class TestVPCOffering(cloudstackTestCase): | |||||||
|         ) |         ) | ||||||
|         self.cleanup.append(nat_rule) |         self.cleanup.append(nat_rule) | ||||||
| 
 | 
 | ||||||
|         self.logger.debug("Adding NetwrokACl rules to make PF and LB accessible") |         self.logger.debug("Adding NetworkACl rules to make PF and LB accessible") | ||||||
|         networkacl_1 = NetworkACL.create( |         networkacl_1 = NetworkACL.create( | ||||||
|             self.apiclient, |             self.apiclient, | ||||||
|             networkid=network.id, |             networkid=network.id, | ||||||
|  | |||||||
| @ -2046,7 +2046,7 @@ class TestVMDeployVPC(cloudstackTestCase): | |||||||
|             self.fail("Failed to enable static NAT on IP: %s - %s" % ( |             self.fail("Failed to enable static NAT on IP: %s - %s" % ( | ||||||
|                                         public_ip_4.ipaddress.ipaddress, e)) |                                         public_ip_4.ipaddress.ipaddress, e)) | ||||||
| 
 | 
 | ||||||
|         self.debug("Adding NetwrokACl rules to make NAT rule accessible with network %s" % network_1.id) |         self.debug("Adding NetworkACl rules to make NAT rule accessible with network %s" % network_1.id) | ||||||
|         NetworkACL.create( |         NetworkACL.create( | ||||||
|                                          self.apiclient, |                                          self.apiclient, | ||||||
|                                          networkid=network_1.id, |                                          networkid=network_1.id, | ||||||
|  | |||||||
| @ -52,7 +52,7 @@ public class DateUtil { | |||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     public static Date currentGMTTime() { |     public static Date currentGMTTime() { | ||||||
|         // Date object always stores miliseconds offset based on GMT internally |         // Date object always stores milliseconds offset based on GMT internally | ||||||
|         return new Date(); |         return new Date(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -65,13 +65,13 @@ public class SynchronizationEvent { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public boolean waitEvent(long timeOutMiliseconds) throws InterruptedException { |     public boolean waitEvent(long timeOutMilliseconds) throws InterruptedException { | ||||||
|         synchronized (this) { |         synchronized (this) { | ||||||
|             if (signalled) |             if (signalled) | ||||||
|                 return true; |                 return true; | ||||||
| 
 | 
 | ||||||
|             try { |             try { | ||||||
|                 wait(timeOutMiliseconds); |                 wait(timeOutMilliseconds); | ||||||
|                 return signalled; |                 return signalled; | ||||||
|             } catch (InterruptedException e) { |             } catch (InterruptedException e) { | ||||||
|                 // TODO, we don't honor time out semantics when the waiting thread is interrupted |                 // TODO, we don't honor time out semantics when the waiting thread is interrupted | ||||||
|  | |||||||
| @ -130,6 +130,6 @@ public class ScriptTest { | |||||||
|     public void testFindScript() { |     public void testFindScript() { | ||||||
|         Assume.assumeTrue(SystemUtils.IS_OS_LINUX); |         Assume.assumeTrue(SystemUtils.IS_OS_LINUX); | ||||||
|         String script = Script.findScript("/bin", "pwd"); |         String script = Script.findScript("/bin", "pwd"); | ||||||
|         Assert.assertNotNull("/bin/pwd shoud be there on linux", script); |         Assert.assertNotNull("/bin/pwd should be there on linux", script); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -114,7 +114,7 @@ public class BaseMO { | |||||||
|                 key = field.getKey(); |                 key = field.getKey(); | ||||||
|             } catch (Exception e) { |             } catch (Exception e) { | ||||||
|                 // assuming the exception is caused by concurrent operation from other places |                 // assuming the exception is caused by concurrent operation from other places | ||||||
|                 // so we retieve the key again |                 // so we retrieve the key again | ||||||
|                 key = getCustomFieldKey(fieldName); |                 key = getCustomFieldKey(fieldName); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -281,7 +281,7 @@ public class DatastoreMO extends BaseMO { | |||||||
|                 return false; |                 return false; | ||||||
|             } |             } | ||||||
|         } catch (Exception e) { |         } catch (Exception e) { | ||||||
|             s_logger.error(String.format("Cannot move file to destination datastore due to file %s due to exeception %s", srcFullPath, e.getMessage())); |             s_logger.error(String.format("Cannot move file to destination datastore due to file %s due to exception %s", srcFullPath, e.getMessage())); | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -307,7 +307,7 @@ public class DatastoreMO extends BaseMO { | |||||||
|         String url = getContext().composeDatastoreBrowseUrl(dcPair.second(), fullPath); |         String url = getContext().composeDatastoreBrowseUrl(dcPair.second(), fullPath); | ||||||
| 
 | 
 | ||||||
|         // TODO, VMware currently does not have a formal API to list Datastore directory content, |         // TODO, VMware currently does not have a formal API to list Datastore directory content, | ||||||
|         // folloing hacking may have performance hit if datastore has a large number of files |         // following hacking may have performance hit if datastore has a large number of files | ||||||
|         return _context.listDatastoreDirContent(url); |         return _context.listDatastoreDirContent(url); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1088,7 +1088,7 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost { | |||||||
| 
 | 
 | ||||||
|         HostListSummaryQuickStats stats = getHostQuickStats(); |         HostListSummaryQuickStats stats = getHostQuickStats(); | ||||||
|         if (stats.getOverallCpuUsage() == null || stats.getOverallMemoryUsage() == null) |         if (stats.getOverallCpuUsage() == null || stats.getOverallMemoryUsage() == null) | ||||||
|             throw new Exception("Unable to get valid overal CPU/Memory usage data, host may be disconnected"); |             throw new Exception("Unable to get valid overall CPU/Memory usage data, host may be disconnected"); | ||||||
| 
 | 
 | ||||||
|         resourceSummary.setEffectiveCpu(totalCpu - stats.getOverallCpuUsage()); |         resourceSummary.setEffectiveCpu(totalCpu - stats.getOverallCpuUsage()); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -159,11 +159,11 @@ public class HttpNfcLeaseMO extends BaseMO { | |||||||
|         public void run() { |         public void run() { | ||||||
|             while (!_done) { |             while (!_done) { | ||||||
|                 try { |                 try { | ||||||
|                     Thread.sleep(1000);            // update progess every 1 second |                     Thread.sleep(1000);            // update progress every 1 second | ||||||
|                     updateLeaseProgress(_percent); |                     updateLeaseProgress(_percent); | ||||||
|                 } catch (InterruptedException e) { |                 } catch (InterruptedException e) { | ||||||
|                     if (s_logger.isInfoEnabled()) |                     if (s_logger.isInfoEnabled()) | ||||||
|                         s_logger.info("ProgressReporter is interrupted, quiting"); |                         s_logger.info("ProgressReporter is interrupted, quitting"); | ||||||
|                     break; |                     break; | ||||||
|                 } catch (Exception e) { |                 } catch (Exception e) { | ||||||
|                     s_logger.warn("Unexpected exception ", e); |                     s_logger.warn("Unexpected exception ", e); | ||||||
|  | |||||||
| @ -1866,7 +1866,7 @@ public class HypervisorHostHelper { | |||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * deploys a new VM from a ovf spec. It ignores network, defaults locale to 'US' |      * deploys a new VM from a ovf spec. It ignores network, defaults locale to 'US' | ||||||
|      * @throws Exception shoud be a VmwareResourceException |      * @throws Exception should be a VmwareResourceException | ||||||
|      */ |      */ | ||||||
|     public static void importVmFromOVF(VmwareHypervisorHost host, String ovfFilePath, String vmName, DatastoreMO dsMo, String diskOption, ManagedObjectReference morRp, |     public static void importVmFromOVF(VmwareHypervisorHost host, String ovfFilePath, String vmName, DatastoreMO dsMo, String diskOption, ManagedObjectReference morRp, | ||||||
|                                        ManagedObjectReference morHost, String configurationId) throws CloudRuntimeException, IOException { |                                        ManagedObjectReference morHost, String configurationId) throws CloudRuntimeException, IOException { | ||||||
|  | |||||||
| @ -1881,7 +1881,7 @@ public class VirtualMachineMO extends BaseMO { | |||||||
| 
 | 
 | ||||||
|                         // tar files into OVA |                         // tar files into OVA | ||||||
|                         if (packToOva) { |                         if (packToOva) { | ||||||
|                             // Important! we need to sync file system before we can safely use tar to work around a linux kernal bug(or feature) |                             // Important! we need to sync file system before we can safely use tar to work around a linux kernel bug(or feature) | ||||||
|                             s_logger.info("Sync file system before we package OVA..."); |                             s_logger.info("Sync file system before we package OVA..."); | ||||||
| 
 | 
 | ||||||
|                             Script commandSync = new Script(true, "sync", 0, s_logger); |                             Script commandSync = new Script(true, "sync", 0, s_logger); | ||||||
|  | |||||||
| @ -550,7 +550,7 @@ public class VmwareContext { | |||||||
|      * Url for the query |      * Url for the query | ||||||
|      *     https://vsphere-1.lab.vmops.com/folder/Fedora-clone-test?dcPath=cupertino&dsName=NFS+datastore |      *     https://vsphere-1.lab.vmops.com/folder/Fedora-clone-test?dcPath=cupertino&dsName=NFS+datastore | ||||||
|      * |      * | ||||||
|      * Returned conent from vSphere |      * Returned content from vSphere | ||||||
|      * |      * | ||||||
|         <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |         <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||||||
|         <html> |         <html> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user