You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2012/07/27 23:01:31 UTC

[11/50] [abbrv] Merge branch 'master' into vpc

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 4a398cf,e837dbd..bb4198f
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@@ -2786,8 -2766,18 +2766,18 @@@ public class VmwareResource implements 
          if (s_logger.isInfoEnabled()) {
              s_logger.info("Executing resource PingTestCommand: " + _gson.toJson(cmd));
          }
- 
+         String controlIp = cmd.getRouterIp();
+         String args = " -c 1 -n -q " + cmd.getPrivateIp();
+         try {
+             VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
+             Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, "/bin/ping" + args);
+             if(result.first())
 -                return new Answer(cmd);
 +        return new Answer(cmd);
+         } catch (Exception e) {
+             s_logger.error("Unable to execute ping command on DomR (" + controlIp + "), domR may not be ready yet. failure due to " 
+                     + VmwareHelper.getExceptionMessage(e), e);
+         }
+         return new Answer(cmd,false,"PingTestCommand failed");
      }
  
      protected Answer execute(CheckOnHostCommand cmd) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --cc plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index e4d52f5,272c357..bfa44c8
--- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@@ -1008,28 -987,18 +1008,33 @@@ public class ElasticLoadBalancerManager
  
          return VirtualMachineName.getSystemVmId(vmName);
      }
 +    
 +    @Override
 +    public boolean plugNic(Network network, NicTO nic, VirtualMachineTO vm,
 +            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException,
 +            InsufficientCapacityException {
 +        //not supported
 +        throw new UnsupportedOperationException("Plug nic is not supported for vm of type " + vm.getType());
 +    }
  
  
 -	@Override
 -	public boolean recreateNeeded(
 -			VirtualMachineProfile<DomainRouterVO> profile, long hostId,
 -			Commands cmds, ReservationContext context) {
 -		// TODO Auto-generated method stub
 -		return false;
 -	}
 +    @Override
 +    public boolean unplugNic(Network network, NicTO nic, VirtualMachineTO vm,
 +            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException {
 +        //not supported
 +        throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
 +     }
 +
 +
 +    @Override
 +    public boolean recreateNeeded(
 +        VirtualMachineProfile<DomainRouterVO> profile, long hostId, Commands cmds, ReservationContext context) {
 +	// TODO Auto-generated method stub
 +	return false;
 +    }
+ 
+     @Override
+     public void prepareStop(VirtualMachineProfile<DomainRouterVO> profile) {
+     } 
+ 
  }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
index 1a09503,a7e457c..f833e98
--- a/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
+++ b/server/src/com/cloud/consoleproxy/AgentBasedConsoleProxyManager.java
@@@ -374,5 -352,9 +374,9 @@@ public class AgentBasedConsoleProxyMana
  			Commands cmds, ReservationContext context) {
  		// TODO Auto-generated method stub
  		return false;
 -	}
 +    }
+ 
+     @Override 
+     public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
+     }
 -}
 +}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 326dbb4,7101375..72d48b4
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@@ -2031,5 -2013,9 +2031,9 @@@ public class ConsoleProxyManagerImpl im
  			Commands cmds, ReservationContext context) {
  		// TODO Auto-generated method stub
  		return false;
 -	}
 +    }
+ 	
+ 	@Override
+ 	public void prepareStop(VirtualMachineProfile<ConsoleProxyVO> profile) {
+ 	}
  }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 93f1baf,82f7231..d2118d2
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@@ -496,47 -504,20 +496,26 @@@ public class VirtualNetworkApplianceMan
          final Transaction txn = Transaction.currentTxn();
          try {
              txn.start();
 -            final UserStatisticsVO userStats = _userStatsDao.lock(router.getAccountId(), router.getDataCenterIdToDeployIn(), router.getNetworkId(), null, router.getId(), router.getType().toString());
 -            if (userStats != null) {
 +            //FIXME!!! - UserStats command should grab bytesSent/Received for all guest interfaces of the VR
 +            List<Long> routerGuestNtwkIds = _routerDao.getRouterNetworks(router.getId());
 +            for (Long guestNtwkId : routerGuestNtwkIds) {
 +                final UserStatisticsVO userStats = _userStatsDao.lock(router.getAccountId(), router.getDataCenterIdToDeployIn(),
 +                        guestNtwkId, null, router.getId(), router.getType().toString());
 +                if (userStats != null) {
-                     final RebootAnswer sa = (RebootAnswer) answer;
-                     final Long received = sa.getBytesReceived();
-                     long netBytes = 0;
-                     if (received != null) {
-                         if (received.longValue() >= userStats.getCurrentBytesReceived()) {
-                             netBytes = received.longValue();
-                         } else {
-                             netBytes = userStats.getCurrentBytesReceived() + received;
-                         }
-                     } else {
-                         netBytes = userStats.getCurrentBytesReceived();
-                     }
+                 final long currentBytesRcvd = userStats.getCurrentBytesReceived();
 -                userStats.setCurrentBytesReceived(0);
 +                    userStats.setCurrentBytesReceived(0);
-                     userStats.setNetBytesReceived(userStats.getNetBytesReceived() + netBytes);
- 
-                     final Long sent = sa.getBytesSent();
+                 userStats.setNetBytesReceived(userStats.getNetBytesReceived() + currentBytesRcvd);
  
-                     if (sent != null) {
-                         if (sent.longValue() >= userStats.getCurrentBytesSent()) {
-                             netBytes = sent.longValue();
-                         } else {
-                             netBytes = userStats.getCurrentBytesSent() + sent;
-                         }
-                     } else {
-                         netBytes = userStats.getCurrentBytesSent();
-                     }
-                     userStats.setNetBytesSent(userStats.getNetBytesSent() + netBytes);
+                 final long currentBytesSent = userStats.getCurrentBytesSent();
 -                userStats.setCurrentBytesSent(0);
 +                    userStats.setCurrentBytesSent(0);
+                 userStats.setNetBytesSent(userStats.getNetBytesSent() + currentBytesSent);
 -                _userStatsDao.update(userStats.getId(), userStats);
 -                s_logger.debug("Successfully updated user statistics as a part of domR " + router + " reboot/stop");
 -            } else {
 -                s_logger.warn("User stats were not created for account " + router.getAccountId() + " and dc " + router.getDataCenterIdToDeployIn());
 +                    _userStatsDao.update(userStats.getId(), userStats);
 +                    s_logger.debug("Successfully updated user statistics as a part of domR " + router + " reboot/stop");
 +                } else {
 +                    s_logger.warn("User stats were not created for account " + router.getAccountId() + " and dc " + router.getDataCenterIdToDeployIn());
 +                }
              }
 +            
              txn.commit();
          } catch (final Exception e) {
              txn.rollback();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/rules/RulesManagerImpl.java
index 14588dd,b45443e..928e6b8
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@@ -372,13 -331,12 +371,15 @@@ public class RulesManagerImpl implement
      }
  
      @Override
+     @ActionEvent(eventType = EventTypes.EVENT_ENABLE_STATIC_NAT, eventDescription = "enabling static nat")
 -    public boolean enableStaticNat(long ipId, long vmId, boolean isSystemVm) throws NetworkRuleConflictException, ResourceUnavailableException {
 +    public boolean enableStaticNat(long ipId, long vmId, long networkId, boolean isSystemVm) 
 +            throws NetworkRuleConflictException, ResourceUnavailableException {
          UserContext ctx = UserContext.current();
          Account caller = ctx.getCaller();
+         UserContext.current().setEventDetails("Ip Id: " + ipId);
  
 +        // Verify input parameters
 +
          IPAddressVO ipAddress = _ipAddressDao.findById(ipId);
          if (ipAddress == null) {
              throw new InvalidParameterValueException("Unable to find ip address by id " + ipId);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/upgrade/dao/Upgrade302to303.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/UserVmManagerImpl.java
index b57ac15,b221ef1..4522557
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@@ -3679,20 -3630,8 +3679,24 @@@ public class UserVmManagerImpl implemen
          return vm;
      }
      
 -	@Override
 +    @Override
 +    public boolean plugNic(Network network, NicTO nic, VirtualMachineTO vm,
 +            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException,
 +            InsufficientCapacityException {
 +        //not supported
 +        throw new UnsupportedOperationException("Plug nic is not supported for vm of type " + vm.getType());
 +    }
 +
 +
 +    @Override
 +    public boolean unplugNic(Network network, NicTO nic, VirtualMachineTO vm,
 +            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException {
 +        //not supported
 +        throw new UnsupportedOperationException("Unplug nic is not supported for vm of type " + vm.getType());
 +    }
++
++    @Override
+ 	public void prepareStop(VirtualMachineProfile<UserVmVO> profile) {
 -	}
++    }
      
  }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/vm/VirtualMachineGuru.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/VirtualMachineGuru.java
index dbd5531,26c3944..2b9114d
--- a/server/src/com/cloud/vm/VirtualMachineGuru.java
+++ b/server/src/com/cloud/vm/VirtualMachineGuru.java
@@@ -82,32 -76,9 +82,40 @@@ public interface VirtualMachineGuru<T e
      Long convertToId(String vmName);
      
      /**
++<<<<<<< HEAD
 +     * Prepare for a nic to be plugged into the network.
 +     * @param network
 +     * @param nic
 +     * @param vm
 +     * @param context
 +     * @param dest TODO
 +     * @return
 +     * @throws ConcurrentOperationException
 +     * @throws ResourceUnavailableException
 +     * @throws InsufficientNetworkCapacityException
 +     */
 +    boolean plugNic(Network network, NicTO nic, VirtualMachineTO vm, 
 +            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, 
 +            ResourceUnavailableException, InsufficientCapacityException;
 +    
 +    /**
 +     * A nic is unplugged from this network.
 +     * @param network
 +     * @param nic
 +     * @param vm
 +     * @param context
 +     * @param dest TODO
 +     * @return
 +     * @throws ConcurrentOperationException
 +     * @throws ResourceUnavailableException
 +     */
 +    boolean unplugNic(Network network, NicTO nic, VirtualMachineTO vm, 
 +            ReservationContext context, DeployDestination dest) throws ConcurrentOperationException, ResourceUnavailableException;
++
++    /**
+      * Prepare Vm for Stop
+      * @param profile
+      * @return
+      */
+     void prepareStop(VirtualMachineProfile<T> profile);
  }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/setup/db/create-schema.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --cc ui/css/cloudstack3.css
index 291711a,876d663..dd1b5d8
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@@ -10004,3 -9969,7 +10006,7 @@@ div.panel.ui-dialog div.list-view div.f
    background-position: -230px -615px;
  }
  
+ .label-hovered {
+   cursor: pointer;
+   color: blue !important;
 -}
++}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/ui/index.jsp
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/ui/scripts/system.js
----------------------------------------------------------------------
diff --cc ui/scripts/system.js
index c08eddc,59d2d87..b369bec
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@@ -8115,7 -7766,29 +8137,29 @@@
                      validation: { required: true },
                      isHidden: true
                    },
 - 
 +
+                   // RBD
+                   rbdmonitor: {
+                     label: 'label.rbd.monitor',
+                     validation: { required: true },
+                     isHidden: true
+                   },
+                   rbdpool: {
+                     label: 'label.rbd.pool',
+                     validation: { required: true },
+                     isHidden: true
+                   },
+                    rbdid: {
+                     label: 'label.rbd.id',
+                     validation: { required: false },
+                     isHidden: true
+                   },
+                    rbdsecret: {
+                     label: 'label.rbd.secret',
+                     validation: { required: false },
+                     isHidden: true
+                   },
+ 
                    //always appear (begin)
                    storageTags: {
                      label: 'label.storage.tags',

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --cc ui/scripts/ui-custom/instanceWizard.js
index ef65963,b94e587..1e8dca9
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@@ -539,31 -539,48 +542,48 @@@
            },
  
            'review': function($step, formData) {
-             return {
-               response: {
-                 success: function(args) {
 -            $step.find('[wizard-field]').each(function() {
 -              var field = $(this).attr('wizard-field');
 -              var fieldName;
 -              var $input = $wizard.find('[wizard-field=' + field + ']').filter(function() {
 -                return $(this).is(':selected') || $(this).is(':checked');
 -              });
 +                  $step.find('[wizard-field]').each(function() {
 +                    var field = $(this).attr('wizard-field');
 +                    var fieldName;
 +                    var $input = $wizard.find('[wizard-field=' + field + ']').filter(function() {
 +                      return $(this).is(':selected') || $(this).is(':checked');
 +                    });
  
 -              if ($input.is('option')) {
 -                fieldName = $input.html();
 -              } else if ($input.is('input[type=radio]')) {
 +                    if ($input.is('option')) {
 +                      fieldName = $input.html();
 +                    } else if ($input.is('input[type=radio]')) {
+                 // Choosen New network as default
+                 if ($input.parents('div.new-network').size()) {
+                   fieldName = $input.closest('div.new-network').find('input[name="new-network-name"]').val();
+                 // Choosen Network from existed
+                 } else if ($input.parents('div.my-networks').size()) {
+                   fieldName = $input.closest('div.select').find('.select-desc .name').html();
+                 } else {
 -                  fieldName = $input.parent().find('.select-desc .name').html();
 -                }
 +                      fieldName = $input.parent().find('.select-desc .name').html();
 +                    }
+               } else if ($input.eq(0).is('input[type=checkbox]')) {
+                 fieldName = '';
+                 $input.each(function(index) {
+                   if (index != 0) fieldName += '<br />';
+                   fieldName += $(this).next('div.select-desc').find('.name').html();
+                 });
+               }
  
 -              if (fieldName) {
 -                $(this).html(fieldName);
 -              } else {
 -                $(this).html('(' + _l('label.none') + ')');
 -              }
 +                    if (fieldName) {
 +                      $(this).html(fieldName);
 +                    } else {
 +                      $(this).html('(' + _l('label.none') + ')');
 +                    }
-                   });
+               
+               var conditionalFieldFrom = $(this).attr('conditional-field');
+               if (conditionalFieldFrom) {
+                 if ($wizard.find('.'+conditionalFieldFrom).css('display') == 'block') {
+                     $(this).closest('div.select').show();
+                 } else {
+                     $(this).closest('div.select').hide();
                  }
                }
-             };
+             });
            }
          };
  

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a39fd612/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------