cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [53/53] [abbrv] git commit: updated refs/heads/rbac to 33cd1ab
Date Wed, 22 Jan 2014 19:28:18 GMT
Merge branch 'master' into rbac


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/33cd1ab9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/33cd1ab9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/33cd1ab9

Branch: refs/heads/rbac
Commit: 33cd1ab9214e09cea887f62d1d8ed41f6e295466
Parents: 82bdde7 b5b4607
Author: Min Chen <min.chen@citrix.com>
Authored: Wed Jan 22 11:23:51 2014 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed Jan 22 11:23:51 2014 -0800

----------------------------------------------------------------------
 LICENSE.header                                  |   10 +-
 .../cloudstack/api-config/module.properties     |   18 +
 .../api-config/spring-api-config-context.xml    |   32 +
 .../network/VirtualNetworkApplianceService.java |    2 +-
 api/src/com/cloud/vm/UserVmService.java         |    8 +
 .../api/command/admin/vm/GetVMUserDataCmd.java  |   81 +
 .../api/response/VMUserDataResponse.java        |   44 +
 .../config/ApiServiceConfiguration.java         |   40 +
 .../bridge/service/core/ec2/EC2Engine.java      |   10 +-
 .../classes/resources/messages.properties       |    4 +-
 .../classes/resources/messages_es.properties    |   66 +-
 .../classes/resources/messages_fr_FR.properties |    2 +
 .../classes/resources/messages_ja.properties    | 1599 ------------------
 .../classes/resources/messages_ja_JP.properties | 1599 ++++++++++++++++++
 .../classes/resources/messages_nl_NL.properties | 1216 +++++++++++++
 .../classes/resources/messages_pl.properties    |  469 +++++
 .../classes/resources/messages_pt_BR.properties |   36 +
 client/tomcatconf/commands.properties.in        |    1 +
 .../virtualnetwork/VirtualRoutingResource.java  |  321 ++--
 core/src/com/cloud/agent/transport/Request.java |   28 +-
 .../src/com/cloud/vm/VmWorkConstants.java       |    1 +
 .../com/cloud/vm/VirtualMachineManagerImpl.java |  192 ++-
 .../src/com/cloud/vm/VmWorkJobDispatcher.java   |   49 +-
 .../orchestration/VolumeOrchestrator.java       |   26 +
 .../com/cloud/upgrade/dao/Upgrade410to420.java  |  170 --
 .../com/cloud/upgrade/dao/Upgrade421to430.java  |  175 ++
 .../com/cloud/upgrade/dao/Upgrade430to440.java  |  163 ++
 .../image/datastore/ImageStoreHelper.java       |    9 +-
 .../image/db/ImageStoreDetailsDaoImpl.java      |    9 +-
 .../storage/volume/VolumeServiceImpl.java       |    6 +-
 .../src/com/cloud/cluster/ClusterManager.java   |    1 -
 .../com/cloud/cluster/ClusterManagerImpl.java   |    2 +-
 .../framework/config/ConfigDepot.java           |    2 +
 .../framework/config/impl/ConfigDepotImpl.java  |   52 +-
 .../jobs/AsyncJobExecutionContext.java          |   48 +-
 .../framework/jobs/dao/VmWorkJobDao.java        |    2 +
 .../framework/jobs/dao/VmWorkJobDaoImpl.java    |   93 +-
 framework/spring/module/pom.xml                 |    1 +
 packaging/centos63/cloud.spec                   |    1 +
 .../HypervResource/HypervResourceController.cs  |    7 +-
 .../resource/HypervDirectConnectResource.java   |   36 +-
 .../kvm/resource/LibvirtVMDefTest.java          |   25 +
 .../cloud/hypervisor/vmware/LegacyZoneVO.java   |   10 +-
 .../hypervisor/vmware/VmwareCleanupMaid.java    |   11 -
 .../hypervisor/vmware/VmwareDatacenterVO.java   |   16 +-
 .../vmware/VmwareDatacenterZoneMapVO.java       |    2 +
 .../vmware/VmwareServerDiscoverer.java          |   28 +-
 .../vmware/manager/VmwareHostService.java       |    9 +-
 .../vmware/manager/VmwareManagerImpl.java       |   62 +-
 .../manager/VmwareStorageManagerImpl.java       |  170 +-
 .../vmware/resource/VmwareResource.java         |  854 +++++-----
 .../cloud/network/CiscoNexusVSMDeviceVO.java    |   38 +-
 .../network/element/CiscoNexusVSMElement.java   |    2 -
 .../VmwareSecondaryStorageResourceHandler.java  |   54 +-
 .../resource/VmwareStorageProcessor.java        |   23 +-
 .../vmware/resource/VmwareResourceTest.java     |    2 +-
 .../motion/VmwareStorageMotionStrategyTest.java |   15 +-
 .../src/com/cloud/hypervisor/XenServerGuru.java |    6 +-
 .../xen/discoverer/XcpServerDiscoverer.java     |   11 +-
 .../xen/resource/CitrixResourceBase.java        |  460 +++--
 .../xen/resource/XenServerConnectionPool.java   |  442 +----
 .../xen/resource/XenServerStorageProcessor.java |   16 +-
 .../lb/ElasticLoadBalancerManagerImpl.java      |    9 +-
 plugins/network-elements/nicira-nvp/pom.xml     |   45 +-
 .../META-INF/cloudstack/nvp/module.properties   |    3 +
 .../cloudstack/nvp/spring-nvp-context.xml       |   30 +-
 ...ortForwardingRulesOnLogicalRouterAnswer.java |    3 +
 ...rtForwardingRulesOnLogicalRouterCommand.java |    3 +
 ...ConfigurePublicIpsOnLogicalRouterAnswer.java |    3 +
 ...onfigurePublicIpsOnLogicalRouterCommand.java |    3 +
 ...gureStaticNatRulesOnLogicalRouterAnswer.java |    3 +
 ...ureStaticNatRulesOnLogicalRouterCommand.java |    3 +
 .../agent/api/CreateLogicalRouterAnswer.java    |    3 +
 .../agent/api/CreateLogicalRouterCommand.java   |    3 +
 .../agent/api/CreateLogicalSwitchAnswer.java    |    3 +
 .../agent/api/CreateLogicalSwitchCommand.java   |    3 +
 .../api/CreateLogicalSwitchPortAnswer.java      |    3 +
 .../api/CreateLogicalSwitchPortCommand.java     |    3 +
 .../agent/api/DeleteLogicalRouterAnswer.java    |    3 +
 .../agent/api/DeleteLogicalRouterCommand.java   |    3 +
 .../agent/api/DeleteLogicalSwitchAnswer.java    |    3 +
 .../agent/api/DeleteLogicalSwitchCommand.java   |    3 +
 .../api/DeleteLogicalSwitchPortAnswer.java      |    3 +
 .../api/DeleteLogicalSwitchPortCommand.java     |    3 +
 .../agent/api/FindLogicalSwitchPortAnswer.java  |    3 +
 .../agent/api/FindLogicalSwitchPortCommand.java |    3 +
 .../agent/api/StartupNiciraNvpCommand.java      |    3 +
 .../api/UpdateLogicalSwitchPortAnswer.java      |    3 +
 .../api/UpdateLogicalSwitchPortCommand.java     |    3 +
 .../api/commands/AddNiciraNvpDeviceCmd.java     |    3 +
 .../api/commands/DeleteNiciraNvpDeviceCmd.java  |    3 +
 .../ListNiciraNvpDeviceNetworksCmd.java         |    3 +
 .../api/commands/ListNiciraNvpDevicesCmd.java   |    3 +
 .../api/response/NiciraNvpDeviceResponse.java   |    3 +
 .../com/cloud/network/NiciraNvpDeviceVO.java    |    3 +
 .../cloud/network/NiciraNvpNicMappingVO.java    |    3 +
 .../cloud/network/NiciraNvpRouterMappingVO.java |    3 +
 .../src/com/cloud/network/dao/NiciraNvpDao.java |    3 +
 .../com/cloud/network/dao/NiciraNvpDaoImpl.java |    3 +
 .../network/dao/NiciraNvpNicMappingDao.java     |    3 +
 .../network/dao/NiciraNvpNicMappingDaoImpl.java |    3 +
 .../network/dao/NiciraNvpRouterMappingDao.java  |    3 +
 .../dao/NiciraNvpRouterMappingDaoImpl.java      |    3 +
 .../cloud/network/element/NiciraNvpElement.java |    3 +
 .../element/NiciraNvpElementService.java        |    3 +
 .../network/guru/NiciraNvpGuestNetworkGuru.java |    3 +
 .../network/nicira/AccessConfiguration.java     |    3 +
 .../com/cloud/network/nicira/AccessRule.java    |    3 +
 .../src/com/cloud/network/nicira/Acl.java       |    3 +
 .../src/com/cloud/network/nicira/AclRule.java   |    3 +
 .../com/cloud/network/nicira/Attachment.java    |    3 +
 .../network/nicira/ControlClusterStatus.java    |    3 +
 .../network/nicira/DestinationNatRule.java      |    3 +
 .../network/nicira/L3GatewayAttachment.java     |    3 +
 .../network/nicira/LogicalRouterConfig.java     |    3 +
 .../cloud/network/nicira/LogicalRouterPort.java |    3 +
 .../com/cloud/network/nicira/LogicalSwitch.java |    3 +
 .../cloud/network/nicira/LogicalSwitchPort.java |    3 +
 .../src/com/cloud/network/nicira/Match.java     |    3 +
 .../src/com/cloud/network/nicira/NatRule.java   |    3 +
 .../com/cloud/network/nicira/NiciraNvpApi.java  |    3 +
 .../network/nicira/NiciraNvpApiException.java   |    3 +
 .../com/cloud/network/nicira/NiciraNvpList.java |    3 +
 .../com/cloud/network/nicira/NiciraNvpTag.java  |    3 +
 .../cloud/network/nicira/PatchAttachment.java   |    3 +
 .../com/cloud/network/nicira/RouterNextHop.java |    3 +
 .../com/cloud/network/nicira/RoutingConfig.java |    3 +
 .../cloud/network/nicira/SecurityProfile.java   |    3 +
 .../com/cloud/network/nicira/SecurityRule.java  |    3 +
 .../SingleDefaultRouteImplictRoutingConfig.java |    3 +
 .../com/cloud/network/nicira/SourceNatRule.java |    3 +
 .../network/nicira/TransportZoneBinding.java    |    3 +
 .../com/cloud/network/nicira/VifAttachment.java |    3 +
 .../network/resource/NiciraNvpResource.java     |    3 +
 .../network/element/NiciraNvpElementTest.java   |    3 +
 .../guru/NiciraNvpGuestNetworkGuruTest.java     |    3 +
 .../com/cloud/network/nicira/NatRuleTest.java   |    3 +
 .../cloud/network/nicira/NiciraNvpApiIT.java    |    3 +
 .../cloud/network/nicira/NiciraNvpApiTest.java  |    3 +
 .../com/cloud/network/nicira/NiciraTagTest.java |    3 +
 .../network/resource/NiciraNvpResourceTest.java |    3 +
 .../nicira-nvp/test/resources/config.properties |    2 +
 plugins/network-elements/opendaylight/pom.xml   |   36 +-
 .../opendaylight/OpendaylightElement.java       |   10 +-
 .../OpendaylightGuestNetworkGuru.java           |   10 +-
 .../agent/OpenDaylightControllerResource.java   |   10 +-
 .../OpenDaylightControllerResourceManager.java  |   10 +-
 ...enDaylightControllerResourceManagerImpl.java |   10 +-
 .../agent/commands/AddHypervisorCommand.java    |   10 +-
 .../agent/commands/ConfigureNetworkCommand.java |   10 +-
 .../agent/commands/ConfigurePortCommand.java    |   10 +-
 .../agent/commands/DestroyNetworkCommand.java   |   10 +-
 .../agent/commands/DestroyPortCommand.java      |   10 +-
 .../StartupOpenDaylightControllerCommand.java   |   10 +-
 .../agent/responses/AddHypervisorAnswer.java    |   10 +-
 .../agent/responses/ConfigureNetworkAnswer.java |   10 +-
 .../agent/responses/ConfigurePortAnswer.java    |   10 +-
 .../agent/responses/DestroyNetworkAnswer.java   |   10 +-
 .../agent/responses/DestroyPortAnswer.java      |   10 +-
 .../api/NeutronInvalidCredentialsException.java |   10 +-
 .../opendaylight/api/NeutronRestApi.java        |   10 +-
 .../api/NeutronRestApiException.java            |   10 +-
 .../opendaylight/api/NeutronRestFactory.java    |   10 +-
 .../commands/AddOpenDaylightControllerCmd.java  |   10 +-
 .../DeleteOpenDaylightControllerCmd.java        |   10 +-
 .../ListOpenDaylightControllersCmd.java         |   10 +-
 .../api/enums/NeutronNorthboundEnum.java        |   10 +-
 .../opendaylight/api/model/NeutronNetwork.java  |   10 +-
 .../api/model/NeutronNetworkWrapper.java        |   10 +-
 .../api/model/NeutronNetworksList.java          |   10 +-
 .../opendaylight/api/model/NeutronNode.java     |   10 +-
 .../api/model/NeutronNodeWrapper.java           |   10 +-
 .../api/model/NeutronNodesList.java             |   10 +-
 .../opendaylight/api/model/NeutronPort.java     |   10 +-
 .../api/model/NeutronPortWrapper.java           |   10 +-
 .../api/model/NeutronPortsList.java             |   10 +-
 .../opendaylight/api/resources/Action.java      |   14 +-
 .../NeutronNetworksNorthboundAction.java        |   10 +-
 .../resources/NeutronNodesNorthboundAction.java |   10 +-
 .../resources/NeutronPortsNorthboundAction.java |   10 +-
 .../OpenDaylightControllerResponse.java         |   10 +-
 .../dao/OpenDaylightControllerMappingDao.java   |   10 +-
 .../OpenDaylightControllerMappingDaoImpl.java   |   10 +-
 .../dao/OpenDaylightControllerVO.java           |   10 +-
 .../cloudstack/opendaylight/module.properties   |   10 +-
 .../spring-opendaylight-context.xml             |   10 +-
 .../opendaylight/api/test/NeutronEnumsTest.java |   10 +-
 .../api/test/NeutronNetworkAdapterTest.java     |   10 +-
 .../api/test/NeutronNodeAdapterTest.java        |   10 +-
 .../api/test/NeutronPortAdapterTest.java        |   10 +-
 .../opendaylight/api/test/NeutronRestApiIT.java |   10 +-
 .../api/test/NeutronRestApiTest.java            |   10 +-
 .../network-elements/stratosphere-ssp/pom.xml   |    2 +-
 .../CloudStackImageStoreLifeCycleImpl.java      |   30 +-
 .../NexentaPrimaryDataStoreLifeCycle.java       |   41 +-
 .../datastore/provider/NexentaHostListener.java |   18 +
 .../datastore/util/NexentaNmsClient.java        |   27 +-
 .../datastore/util/NexentaStorAppliance.java    |   23 +-
 .../util/NexentaStorApplianceTest.java          |   18 +
 .../storage/datastore/util/NexentaUtilTest.java |   18 +
 .../driver/SolidfirePrimaryDataStoreDriver.java |    7 +
 .../cloudstack/ldap/LdapAuthenticator.java      |   15 +-
 .../cloud/server/auth/MD5UserAuthenticator.java |    9 +-
 .../server/auth/PlainTextUserAuthenticator.java |    9 +-
 .../auth/SHA256SaltedUserAuthenticator.java     |   10 +-
 .../server/auth/test/AuthenticatorTest.java     |   10 +-
 pom.xml                                         |   73 +-
 scripts/network/domr/bumpUpPriority.sh          |   47 -
 scripts/network/domr/call_dnsmasq.sh            |   27 -
 scripts/network/domr/call_firewall.sh           |   70 -
 scripts/network/domr/call_loadbalancer.sh       |  101 --
 scripts/network/domr/createipAlias.sh           |   26 -
 scripts/network/domr/deleteipAlias.sh           |   25 -
 scripts/network/domr/dhcp_entry.sh              |   82 -
 scripts/network/domr/s2s_vpn.sh                 |   29 -
 scripts/network/domr/save_password_to_domr.sh   |   73 -
 scripts/vm/hypervisor/xenserver/vmops           |  113 +-
 scripts/vm/network/security_group.py            |    2 +-
 server/src/com/cloud/api/ApiServer.java         |    7 +-
 .../api/query/dao/ImageStoreJoinDaoImpl.java    |   28 +-
 .../api/query/dao/StoragePoolJoinDaoImpl.java   |   13 +-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |   11 +-
 .../VirtualNetworkApplianceManagerImpl.java     |    7 +-
 .../cloud/server/ConfigurationServerImpl.java   |    9 +-
 .../com/cloud/server/ManagementServerImpl.java  |    2 +
 .../cloud/server/auth/UserAuthenticator.java    |    8 +-
 .../com/cloud/storage/VolumeApiServiceImpl.java |  103 +-
 .../secondary/SecondaryStorageManagerImpl.java  |    6 +-
 .../src/com/cloud/user/AccountManagerImpl.java  |   17 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java  |   21 +
 .../vm/snapshot/VMSnapshotManagerImpl.java      |   72 +-
 setup/db/db/schema-421to430.sql                 |   26 +-
 setup/db/templates.sql                          |    2 +-
 .../config/opt/cloud/bin/bumpup_priority.sh     |   19 +
 .../config/opt/cloud/bin/createIpAlias.sh       |  100 ++
 .../config/opt/cloud/bin/deleteIpAlias.sh       |   60 +
 .../debian/config/opt/cloud/bin/dnsmasq.sh      |  130 ++
 .../debian/config/opt/cloud/bin/edithosts.sh    |  234 +++
 .../config/opt/cloud/bin/firewall_egress.sh     |  187 ++
 .../config/opt/cloud/bin/firewall_ingress.sh    |  202 +++
 .../debian/config/opt/cloud/bin/firewall_nat.sh |  358 ++++
 .../debian/config/opt/cloud/bin/loadbalancer.sh |  320 ++++
 .../debian/config/root/bumpup_priority.sh       |   19 -
 .../patches/debian/config/root/createIpAlias.sh |  100 --
 .../patches/debian/config/root/deleteIpAlias.sh |   60 -
 systemvm/patches/debian/config/root/dnsmasq.sh  |  130 --
 .../patches/debian/config/root/edithosts.sh     |  234 ---
 systemvm/patches/debian/config/root/firewall.sh |  358 ----
 .../debian/config/root/firewallRule_egress.sh   |  187 --
 .../patches/debian/config/root/firewall_rule.sh |  202 ---
 .../patches/debian/config/root/loadbalancer.sh  |  320 ----
 systemvm/patches/debian/config/root/userdata.py |   92 -
 systemvm/patches/debian/config/root/userdata.sh |  165 --
 tools/appliance/convert/Convert.java            |    8 +-
 tools/appliance/convert_ovf_vbox_to_esx.xslt    |   24 +-
 tools/transifex/.tx/config                      |    4 +-
 tools/transifex/sync-transifex-ui.sh            |    2 +-
 ui/index.jsp                                    |    4 +-
 ui/scripts/instanceWizard.js                    |    6 +-
 ui/scripts/instances.js                         |   16 +-
 ui/scripts/network.js                           |   13 +
 ui/scripts/sharedFunctions.js                   |    4 +-
 .../cloud/hypervisor/vmware/mo/ClusterMO.java   |   28 +-
 .../vmware/mo/CustomFieldsManagerMO.java        |    2 +-
 .../vmware/mo/DistributedVirtualSwitchMO.java   |    3 +-
 .../vmware/mo/HostDatastoreSystemMO.java        |    2 +-
 .../vmware/mo/HostFirewallSystemMO.java         |    1 +
 .../com/cloud/hypervisor/vmware/mo/HostMO.java  |   52 +-
 .../vmware/mo/HostNetworkSystemMO.java          |    1 +
 .../vmware/mo/HypervisorHostHelper.java         |   40 +-
 .../vmware/mo/LicenseAssignmentManagerMO.java   |    4 +-
 .../hypervisor/vmware/mo/LicenseManagerMO.java  |    1 +
 .../cloud/hypervisor/vmware/mo/NetworkMO.java   |    2 +-
 .../hypervisor/vmware/mo/PerfManagerMO.java     |    6 +-
 .../vmware/mo/VirtualDiskManagerMO.java         |    3 +-
 .../hypervisor/vmware/mo/VirtualMachineMO.java  |   75 +-
 .../hypervisor/vmware/util/VmwareClient.java    |   18 +-
 .../hypervisor/vmware/util/VmwareContext.java   |   15 +-
 .../vmware/util/VmwareContextPool.java          |   35 -
 .../vmware/util/VmwareGuestOsMapper.java        |    4 +
 .../hypervisor/vmware/util/VmwareHelper.java    |   87 +-
 281 files changed, 8225 insertions(+), 6680 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
index c9be8a7,052c56c..3158905
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
@@@ -23,8 -23,9 +23,9 @@@ import java.sql.PreparedStatement
  import java.sql.ResultSet;
  import java.sql.SQLException;
  
 -import com.cloud.network.Network;
  import org.apache.log4j.Logger;
  
++import com.cloud.network.Network;
  import com.cloud.utils.exception.CloudRuntimeException;
  import com.cloud.utils.script.Script;
  
@@@ -58,54 -59,170 +59,216 @@@ public class Upgrade430to440 implement
  
      @Override
      public void performDataMigration(Connection conn) {
 +        populateACLGroupAccountMap(conn);
+         secondaryIpsAccountAndDomainIdsUpdate(conn);
      }
  
 +    // populate acl_group_account_map table for existing accounts
 +    private void populateACLGroupAccountMap(Connection conn) {
 +        PreparedStatement acctInsert = null;
 +        PreparedStatement acctQuery = null;
 +        ResultSet rs = null;
 +
 +        s_logger.debug("Populating acl_group_account_map table for existing accounts...");
 +        try {
 +            acctInsert = conn
 +                    .prepareStatement("INSERT INTO `cloud`.`acl_group_account_map` (group_id,
account_id, created) values(?, ?, Now())");
 +            acctQuery = conn
 +                    .prepareStatement("select id, type from `cloud`.`account` where removed
is null");
 +            rs = acctQuery.executeQuery();
 +
 +            while (rs.next()) {
 +                Long acct_id = rs.getLong("id");
 +                short type = rs.getShort("type");
 +
 +                // insert entry in acl_group_account_map table
 +                acctInsert.setLong(1, type + 1);
 +                acctInsert.setLong(2, acct_id);
 +                acctInsert.executeUpdate();
 +            }
 +        } catch (SQLException e) {
 +            String msg = "Unable to populate acl_group_account_map for existing accounts."
+ e.getMessage();
 +            s_logger.error(msg);
 +            throw new CloudRuntimeException(msg, e);
 +        } finally {
 +            try {
 +                if (rs != null) {
 +                    rs.close();
 +                }
 +
 +                if (acctInsert != null) {
 +                    acctInsert.close();
 +                }
 +                if (acctQuery != null) {
 +                    acctQuery.close();
 +                }
 +            } catch (SQLException e) {
 +            }
 +        }
 +        s_logger.debug("Completed populate acl_group_account_map for existing accounts.");
 +    }
 +
+ 
+ 
+     private void secondaryIpsAccountAndDomainIdsUpdate(Connection conn) {
+         PreparedStatement pstmt = null;
+         PreparedStatement pstmtVm = null;
+         PreparedStatement pstmtNw = null;
+         PreparedStatement pstmtUpdate = null;
+ 
+         ResultSet rs1 = null;
+         ResultSet vmRs = null;
+         ResultSet networkRs = null;
+ 
+         String secondIpsSql = "SELECT id, vmId, network_id, account_id, domain_id, ip4_address
FROM `cloud`.`nic_secondary_ips`";
+ 
+         try {
+             pstmt = conn.prepareStatement(secondIpsSql);
+             rs1 = pstmt.executeQuery();
+ 
+             while(rs1.next()) {
+                 long ipId = rs1.getLong(1);
+                 long vmId = rs1.getLong(2);
+                 long networkId = rs1.getLong(3);
+                 long accountId = rs1.getLong(4);
+                 long domainId = rs1.getLong(5);
+                 String ipAddr = rs1.getString(6);
+ 
+                 pstmtVm = conn.prepareStatement("SELECT account_id, domain_id FROM `cloud`.`vm_instance`
where id = ?");
+                 pstmtVm.setLong(1,vmId);
+ 
+                 vmRs = pstmtVm.executeQuery();
+ 
+                 if (vmRs.next()) {
+                     long vmAccountId = vmRs.getLong(1);
+                     long vmDomainId = vmRs.getLong(2);
+ 
+                     if (vmAccountId != accountId && vmAccountId != domainId) {
+                         // update the secondary ip accountid and domainid to vm accountid
domainid
+                         // check the network type. If network is shared accountid doaminid
needs to be updated in
+                         // in both nic_secondary_ips table and user_ip_address table
+ 
+                         pstmtUpdate = conn.prepareStatement("UPDATE `cloud`.`nic_secondary_ips`
SET account_id = ?, domain_id= ? WHERE id = ?");
+                         pstmtUpdate.setLong(1, vmAccountId);
+                         pstmtUpdate.setLong(2,vmDomainId);
+                         pstmtUpdate.setLong(3,ipId);
+                         pstmtUpdate.executeUpdate();
+                         pstmtUpdate.close();
+ 
+                         pstmtNw = conn.prepareStatement("SELECT guest_type FROM `cloud`.`networks`
where id = ?");
+                         pstmtNw.setLong(1,networkId);
+ 
+                         networkRs = pstmtNw.executeQuery();
+                         if (networkRs.next()) {
+                             String guesttype = networkRs.getString(1);
+ 
+                             if (guesttype == Network.GuestType.Shared.toString()) {
+                                 pstmtUpdate = conn.prepareStatement("UPDATE `cloud`.`user_ip_address`
SET account_id = ?, domain_id= ? WHERE public_ip_address = ?");
+                                 pstmtUpdate.setLong(1,vmAccountId);
+                                 pstmtUpdate.setLong(2,vmDomainId);
+                                 pstmtUpdate.setString(3,ipAddr);
+                                 pstmtUpdate.executeUpdate();
+                                 pstmtUpdate.close();
+ 
+                             }
+                         }
+ 
+ 
+                         if (networkRs != null) {
+                             try {
+                                 networkRs.close();
+                             } catch (SQLException e) {
+                             }
+                         }
+ 
+ 
+                         if (pstmtNw != null) {
+                             try {
+                                 pstmtNw.close();
+ 
+                             } catch (SQLException e) {
+                             }
+                         }
+ 
+                     }
+                 } //if
+ 
+ 
+                 if (vmRs != null) {
+                     try {
+                         vmRs.close();
+                     } catch (SQLException e) {
+                     }
+                 }
+ 
+                 if (networkRs != null) {
+                     try {
+                         networkRs.close();
+                     } catch (SQLException e) {
+                     }
+                 }
+ 
+ 
+             } // while
+ 
+ 
+         } catch (SQLException e) {
+             throw new CloudRuntimeException("Exception while Moving private zone information
to dedicated resources", e);
+         } finally {
+ 
+             if (pstmt != null) {
+                 try {
+                     pstmt.close();
+ 
+                 } catch (SQLException e) {
+                 }
+             }
+ 
+ 
+             if (pstmtVm != null) {
+                 try {
+                     pstmtVm.close();
+                 } catch (SQLException e) {
+                 }
+             }
+ 
+ 
+             if (pstmtNw != null) {
+                 try {
+                     pstmtNw.close();
+ 
+                 } catch (SQLException e) {
+                 }
+             }
+ 
+             if (rs1 != null) {
+                 try {
+                     rs1.close();
+                 } catch (SQLException e) {
+                 }
+             }
+ 
+             if (vmRs != null) {
+                 try {
+                     vmRs.close();
+                 } catch (SQLException e) {
+                 }
+             }
+ 
+             if (networkRs != null) {
+                 try {
+                     networkRs.close();
+                 } catch (SQLException e) {
+                 }
+             }
+         }
+         s_logger.debug("Done updating vm nic secondary ip  account and domain ids");
+     }
+ 
+ 
+ 
+ 
+ 
      @Override
      public File[] getCleanupScripts() {
          String script = Script.findScript("", "db/schema-430to440-cleanup.sql");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/plugins/network-elements/nicira-nvp/src/com/cloud/api/commands/ListNiciraNvpDeviceNetworksCmd.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/server/ManagementServerImpl.java
index 33c5c0f,bbb31cf..d72390f
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@@ -201,7 -198,7 +201,8 @@@ import org.apache.cloudstack.api.comman
  import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd;
  import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
  import org.apache.cloudstack.api.command.admin.vm.ExpungeVMCmd;
+ import org.apache.cloudstack.api.command.admin.vm.GetVMUserDataCmd;
 +import org.apache.cloudstack.api.command.admin.vm.ListVMsCmdByAdmin;
  import org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd;
  import org.apache.cloudstack.api.command.admin.vm.MigrateVirtualMachineWithVolumeCmd;
  import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/storage/VolumeApiServiceImpl.java
index d80f238,a79d8b4..1d78789
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@@ -911,8 -916,19 +916,19 @@@ public class VolumeApiServiceImpl exten
              AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
              if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
                  // avoid re-entrance
+ 
+                 VmWorkJobVO placeHolder = null;
+                 if (VmJobEnabled.value()) {
+                     placeHolder = createPlaceHolderWork(userVm.getId());
+                 }
+                 try {
 -                    return orchestrateResizeVolume(volume.getId(), currentSize, newSize,
 -                            newDiskOffering != null ? cmd.getNewDiskOfferingId() : null,
shrinkOk);
 +                return orchestrateResizeVolume(volume.getId(), currentSize, newSize,
 +                        newDiskOffering != null ? cmd.getNewDiskOfferingId() : null, shrinkOk);
+                 } finally {
+                     if (VmJobEnabled.value())
+                         _workJobDao.expunge(placeHolder.getId());
+                 }
+ 
              } else {
                  Outcome<Volume> outcome = resizeVolumeThroughJobQueue(userVm.getId(),
volume.getId(), currentSize, newSize,
                          newDiskOffering != null ? cmd.getNewDiskOfferingId() : null, shrinkOk);
@@@ -1102,7 -1118,18 +1118,18 @@@
          AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
          if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
              // avoid re-entrance
+ 
+             VmWorkJobVO placeHolder = null;
+             if (VmJobEnabled.value()) {
+                 placeHolder = createPlaceHolderWork(command.getVirtualMachineId());
+             }
+             try {
 -                return orchestrateAttachVolumeToVM(command.getVirtualMachineId(), command.getId(),
command.getDeviceId());
 +            return orchestrateAttachVolumeToVM(command.getVirtualMachineId(), command.getId(),
command.getDeviceId());
+             } finally {
+                 if (VmJobEnabled.value())
+                     _workJobDao.expunge(placeHolder.getId());
+             }
+ 
          } else {
              Outcome<Volume> outcome = attachVolumeToVmThroughJobQueue(command.getVirtualMachineId(),
command.getId(), command.getDeviceId());
  
@@@ -1405,7 -1432,16 +1432,16 @@@
          AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
          if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
              // avoid re-entrance
+             VmWorkJobVO placeHolder = null;
+             if (VmJobEnabled.value()) {
+                 placeHolder = createPlaceHolderWork(vmId);
+             }
+             try {
 -                return orchestrateDetachVolumeFromVM(vmId, volumeId);
 +            return orchestrateDetachVolumeFromVM(vmId, volumeId);
+             } finally {
+                 if (VmJobEnabled.value())
+                     _workJobDao.expunge(placeHolder.getId());
+             }
          } else {
              Outcome<Volume> outcome = detachVolumeFromVmThroughJobQueue(vmId, volumeId);
  
@@@ -1570,7 -1607,18 +1607,18 @@@
              AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
              if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
                  // avoid re-entrance
+ 
+                 VmWorkJobVO placeHolder = null;
+                 if (VmJobEnabled.value()) {
+                     placeHolder = createPlaceHolderWork(vm.getId());
+                 }
+                 try {
 -                    return orchestrateMigrateVolume(vol.getId(), destPool.getId(), liveMigrateVolume);
 +                return orchestrateMigrateVolume(vol.getId(), destPool.getId(), liveMigrateVolume);
+                 } finally {
+                     if (VmJobEnabled.value())
+                         _workJobDao.expunge(placeHolder.getId());
+                 }
+ 
              } else {
                  Outcome<Volume> outcome = migrateVolumeThroughJobQueue(vm.getId(),
vol.getId(), destPool.getId(), liveMigrateVolume);
  
@@@ -1661,7 -1709,18 +1709,18 @@@
              AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
              if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
                  // avoid re-entrance
+ 
+                 VmWorkJobVO placeHolder = null;
+                 if (VmJobEnabled.value()) {
+                     placeHolder = createPlaceHolderWork(vm.getId());
+                 }
+                 try {
 -                    return orchestrateTakeVolumeSnapshot(volumeId, policyId, snapshotId,
account, quiescevm);
 +                return orchestrateTakeVolumeSnapshot(volumeId, policyId, snapshotId, account,
quiescevm);
+                 } finally {
+                     if (VmJobEnabled.value())
+                         _workJobDao.expunge(placeHolder.getId());
+                 }
+ 
              } else {
                  Outcome<Snapshot> outcome = takeVolumeSnapshotThroughJobQueue(vm.getId(),
volumeId, policyId, snapshotId, account.getId(), quiescevm);
  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/user/AccountManagerImpl.java
index e02f339,186cfb2..9b9a4b8
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@@ -37,11 -38,7 +38,8 @@@ import javax.ejb.Local
  import javax.inject.Inject;
  import javax.naming.ConfigurationException;
  
- import org.apache.commons.codec.binary.Base64;
- import org.apache.log4j.Logger;
- 
  import org.apache.cloudstack.acl.ControlledEntity;
 +import org.apache.cloudstack.acl.QuerySelector;
  import org.apache.cloudstack.acl.RoleType;
  import org.apache.cloudstack.acl.SecurityChecker;
  import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@@ -55,12 -51,13 +53,14 @@@ import org.apache.cloudstack.api.comman
  import org.apache.cloudstack.context.CallContext;
  import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
  import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 +import org.apache.cloudstack.framework.messagebus.MessageBus;
 +import org.apache.cloudstack.framework.messagebus.PublishScope;
  import org.apache.cloudstack.managed.context.ManagedContextRunnable;
  import org.apache.cloudstack.region.gslb.GlobalLoadBalancerRuleDao;
+ import org.apache.commons.codec.binary.Base64;
+ import org.apache.log4j.Logger;
  
  import com.cloud.api.ApiDBUtils;
 -import com.cloud.api.query.vo.ControlledViewEntity;
  import com.cloud.configuration.Config;
  import com.cloud.configuration.ConfigurationManager;
  import com.cloud.configuration.Resource.ResourceOwnerType;
@@@ -2077,14 -2016,16 +2084,16 @@@ public class AccountManagerImpl extend
                      if (!isInternalAccount(userAccount.getType())) {
                          // Internal accounts are not disabled
                          int attemptsMade = userAccount.getLoginAttempts() + 1;
+                         if (updateIncorrectLoginCount) {
 -                            if (attemptsMade < _allowedLoginAttempts) {
 -                                updateLoginAttempts(userAccount.getId(), attemptsMade, false);
 -                                s_logger.warn("Login attempt failed. You have " + (_allowedLoginAttempts
- attemptsMade) + " attempt(s) remaining");
 -                            } else {
 -                                updateLoginAttempts(userAccount.getId(), _allowedLoginAttempts,
true);
 -                                s_logger.warn("User " + userAccount.getUsername() + " has
been disabled due to multiple failed login attempts." + " Please contact admin.");
 -                            }
 +                        if (attemptsMade < _allowedLoginAttempts) {
 +                            updateLoginAttempts(userAccount.getId(), attemptsMade, false);
 +                            s_logger.warn("Login attempt failed. You have " + (_allowedLoginAttempts
- attemptsMade) + " attempt(s) remaining");
 +                        } else {
 +                            updateLoginAttempts(userAccount.getId(), _allowedLoginAttempts,
true);
 +                            s_logger.warn("User " + userAccount.getUsername() + " has been
disabled due to multiple failed login attempts." + " Please contact admin.");
                          }
                      }
++                    }
                  } else {
                      s_logger.info("User " + userAccount.getUsername() + " is disabled/locked");
                  }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/UserVmManagerImpl.java
index e4ebed0,fc0ec0e..4b9eceb
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@@ -960,10 -965,14 +960,14 @@@ public class UserVmManagerImpl extends 
          if (network == null) {
              throw new InvalidParameterValueException("unable to find a network with id "
+ networkId);
          }
+ 
+         if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
 -            if (!(network.getGuestType() == Network.GuestType.Shared && network.getAclType()
== ACLType.Domain)
 -                    && !(network.getAclType() == ACLType.Account && network.getAccountId()
== vmInstance.getAccountId())) {
 -                throw new InvalidParameterValueException("only shared network or isolated
network with the same account_id can be added to vmId: " + vmId);
 -            }
 +        if (!(network.getGuestType() == Network.GuestType.Shared && network.getAclType()
== ACLType.Domain)
 +                && !(network.getAclType() == ACLType.Account && network.getAccountId()
== vmInstance.getAccountId())) {
 +            throw new InvalidParameterValueException("only shared network or isolated network
with the same account_id can be added to vmId: " + vmId);
 +        }
+         }
+ 
          List<NicVO> allNics = _nicDao.listByVmId(vmInstance.getId());
          for (NicVO nic : allNics) {
              if (nic.getNetworkId() == network.getId())
@@@ -2630,10 -2636,15 +2634,15 @@@
              if (network.getDataCenterId() != zone.getId()) {
                  throw new InvalidParameterValueException("Network id=" + network.getId()
+ " doesn't belong to zone " + zone.getId());
              }
+ 
+             //relax the check if the caller is admin account
+             if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) {
 -                if (!(network.getGuestType() == Network.GuestType.Shared && network.getAclType()
== ACLType.Domain)
 -                        && !(network.getAclType() == ACLType.Account &&
network.getAccountId() == accountId)) {
 -                    throw new InvalidParameterValueException("only shared network or isolated
network with the same account_id can be added to vm");
 -                }
 +            if (!(network.getGuestType() == Network.GuestType.Shared && network.getAclType()
== ACLType.Domain)
 +                    && !(network.getAclType() == ACLType.Account && network.getAccountId()
== accountId)) {
 +                throw new InvalidParameterValueException("only shared network or isolated
network with the same account_id can be added to vm");
 +            }
+             }
+ 
              IpAddresses requestedIpPair = null;
              if (requestedIps != null && !requestedIps.isEmpty()) {
                  requestedIpPair = requestedIps.get(network.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/33cd1ab9/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index a0de839,1e3926d..5ca44c3
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@@ -366,7 -369,17 +371,17 @@@ public class VMSnapshotManagerImpl exte
          AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
          if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
              // avoid re-entrance
+             VmWorkJobVO placeHolder = null;
+             if (VmJobEnabled.value()) {
+                 placeHolder = createPlaceHolderWork(vmId);
+             }
+             try {
 -                return orchestrateCreateVMSnapshot(vmId, vmSnapshotId, quiescevm);
 +            return orchestrateCreateVMSnapshot(vmId, vmSnapshotId, quiescevm);
+             } finally {
+                 if (VmJobEnabled.value())
+                     _workJobDao.expunge(placeHolder.getId());
+             }
+ 
          } else {
              Outcome<VMSnapshot> outcome = createVMSnapshotThroughJobQueue(vmId, vmSnapshotId,
quiescevm);
  
@@@ -454,7 -467,16 +469,16 @@@
          AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
          if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
              // avoid re-entrance
+             VmWorkJobVO placeHolder = null;
+             if (VmJobEnabled.value()) {
+                 placeHolder = createPlaceHolderWork(vmSnapshot.getVmId());
+             }
+             try {
 -                return orchestrateDeleteVMSnapshot(vmSnapshotId);
 +            return orchestrateDeleteVMSnapshot(vmSnapshotId);
+             } finally {
+                 if (VmJobEnabled.value())
+                     _workJobDao.expunge(placeHolder.getId());
+             }
          } else {
              Outcome<VMSnapshot> outcome = deleteVMSnapshotThroughJobQueue(vmSnapshot.getVmId(),
vmSnapshotId);
  
@@@ -560,7 -582,18 +584,18 @@@
          AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
          if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
              // avoid re-entrance
+ 
+             VmWorkJobVO placeHolder = null;
+             if (VmJobEnabled.value()) {
+                 placeHolder = createPlaceHolderWork(vmSnapshotVo.getVmId());
+             }
+             try {
 -                return orchestrateRevertToVMSnapshot(vmSnapshotId);
 +            return orchestrateRevertToVMSnapshot(vmSnapshotId);
+             } finally {
+                 if (VmJobEnabled.value())
+                     _workJobDao.expunge(placeHolder.getId());
+             }
+ 
          } else {
              Outcome<VMSnapshot> outcome = revertToVMSnapshotThroughJobQueue(vmSnapshotVo.getVmId(),
vmSnapshotId);
  
@@@ -686,7 -719,17 +721,17 @@@
          AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
          if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
              // avoid re-entrance
+             VmWorkJobVO placeHolder = null;
+             if (VmJobEnabled.value()) {
+                 placeHolder = createPlaceHolderWork(vmId);
+             }
+             try {
 -                return orchestrateDeleteAllVMSnapshots(vmId, type);
 +            return orchestrateDeleteAllVMSnapshots(vmId, type);
+             } finally {
+                 if (VmJobEnabled.value())
+                     _workJobDao.expunge(placeHolder.getId());
+             }
+ 
          } else {
              Outcome<VirtualMachine> outcome = deleteAllVMSnapshotsThroughJobQueue(vmId,
type);
  


Mime
View raw message