802 Commits

Author SHA1 Message Date
Min Chen
a88ce6bb7f Remove IdentityProxy from CloudException and ExceptionResponse. 2012-12-19 23:49:44 -08:00
Rohit Yadav
af28c06998 api: move and group all under command, org.apache.cloudstack.command.*
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 18:30:54 -08:00
Rohit Yadav
e07106db0b api_refactor: usage apis to admin.usage pkg
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-05 14:31:31 -08:00
Rohit Yadav
47ae62e44a api_refactor: refactor network apis
- Fix refactored apis in commands*.in
- Fix comments etc.
- Expand tabs, remove trailing whitespace
- Fix trailing whitespaces for all *.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-03 22:47:07 -08:00
Rohit Yadav
5edfc2760a refactor: remove redundant imports, fix trailing chars 2012-12-03 13:54:37 -08:00
Rohit Yadav
4c86b1545d CLOUDSTACK-424: Update userdata should propagate to VR
The code that would propage userdata to router, when updateVirtualMachine api
is called, was missing. As per the docs [0], userdata should be a base64 encoded
string upto 2KB which is put on domr's html directory adn using HTTP GET the
userdata information can be obtained from the domr.

The updateVirtualMachine api [0] would accept a base64 encoded string
and decoded and put into the domr's /var/www/html/userdata/<uservm ip>/user-data
file. The operation does not require the VM to be in stopped state, though it is
advised to stop and call this api in case the user vm has a script which gets
the userdata information from domr while starting.

For example, this script can be used to fetch the data:
server_ip=$(grep dhcp-server-identifier /var/lib/dhclient-eth0.leases | tail -1 | awk '{print $NF}' | tr '\;' ' ')
wget http://${server_ip}/latest/user-data

This feature can be useful, for example to use into puppet facts [1], or to do
automation and horizontal scaling etc. based on userdata.

[0] http://incubator.apache.org/cloudstack/docs/api/apidocs-4.0.0/domain_admin/updateVirtualMachine.html
[1] http://geek.jasonhancock.com/2011/11/09/cloudstack-userdata-into-puppet-facts/

BUG-ID : CLOUDSTACK-424
Reviewed-by: Rohit Yadav <bhaisaab@apache.org>
Reported-by: Nick Wales

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-15 18:43:51 +05:30
Pranav Saxena
fe460fac43 Upgrading a network that has Network offering SRX/F5 inline mode to a network offering that has all service provided by VR does not give proper error message: Hence correcting the error message 2012-11-15 13:52:54 +05:30
Alena Prokharchyk
74622a4dc3 Fixed listNetworks for the case when a) caller is an admin 2) projectId=-1 is specified - admin wasn't able to list networks belonging to regular users' projects 2012-11-14 14:59:51 -08:00
Alena Prokharchyk
705130e42c CS-16499: removed useless txn.commit statement. Used to call it to ensure that the lock() on nic object will get removed even in case when we don't do the DB update. But our Transaction code does it automatic 2012-11-02 09:59:37 -07:00
Alena Prokharchyk
597bc8c66c CS-16499: forgot to add @DB to releaseNic() call 2012-11-02 09:59:36 -07:00
Alena Prokharchyk
7bd7884f57 CS-16499: releaseNic - lock the nic row in the DB before checking its state. Hold the lock till the nics attributes + nicCount is updated
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
2012-11-02 09:59:36 -07:00
Hugo Trippaers
e24456f487 [CLOUDSTACK-415] Workaround this problem for now 2012-10-29 09:26:14 +01:00
Alena Prokharchyk
214bbf3ebd CLOUDSTACK-279: fixed deleteProject when executed by the regular user. Always pass System account as a caller when do account cleanup
Conflicts:

	api/src/com/cloud/api/commands/DeleteRemoteAccessVpnCmd.java
	server/src/com/cloud/network/element/CiscoNexusVSMElement.java
	server/src/com/cloud/network/element/ElasticLoadBalancerElement.java
	server/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
	server/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java
	server/src/com/cloud/network/element/NetscalerElement.java
	server/src/com/cloud/network/element/OvsElement.java
	server/src/com/cloud/network/element/VpcJuniperSRXExternalFirewallElement.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
	server/src/com/cloud/storage/StorageManager.java
2012-10-17 17:26:19 -07:00
Alena Prokharchyk
a9fab0526b CLOUDSTACK-348: decrement resource count when the network gets removed
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
2012-10-16 16:18:36 -07:00
Alena Prokharchyk
3f5733cea7 CS-16412: fixed count for following commands:
listVlanIpRanges
listOsCategories
listOsTypes
listSystemVms
listPhysicalNetworks
listCounters
listConditions
listAutoScalePolicies
listAutoScaleVmProfiles
listAutoScaleVmGroups
listConfigurations
listStoragePools
listClusters
listPods
listInstanceGroups
listSSHKeyPairs
listHypervisorCapabilities
listNetworkServiceProviders
listVpnCustomerGateways
listVpnGateways
listVpnConnections
listProjects
listProjectAccounts
listProjectInvitations
listTrafficTypes

Conflicts:

	api/src/com/cloud/api/commands/ListAutoScalePoliciesCmd.java
	api/src/com/cloud/api/commands/ListAutoScaleVmGroupsCmd.java
	api/src/com/cloud/api/commands/ListAutoScaleVmProfilesCmd.java
	api/src/com/cloud/api/commands/ListConditionsCmd.java
	api/src/com/cloud/api/commands/ListCountersCmd.java
	api/src/com/cloud/api/commands/ListVpnConnectionsCmd.java
	api/src/com/cloud/api/commands/ListVpnCustomerGatewaysCmd.java
	api/src/com/cloud/api/commands/ListVpnGatewaysCmd.java
	api/src/com/cloud/network/as/AutoScaleService.java
	server/src/com/cloud/network/as/AutoScaleManagerImpl.java
	server/src/com/cloud/network/as/dao/CounterDao.java
	server/src/com/cloud/network/as/dao/CounterDaoImpl.java
	server/src/com/cloud/projects/ProjectManagerImpl.java
	server/src/com/cloud/server/ManagementServerImpl.java
2012-10-15 18:16:59 -07:00
Rohit Yadav
6dd5c3fd42 CLOUDSTACK-70: Improve restart network behaviour for basic network
If cleanup=true, network elements and resources are shutdown and
reimplemented. Else, shutdown/reimplementation is skipped. Enabled
cleanup checkbox in CS UI.

For both cases, VRs are only deployed for Pods with no running
or starting VRs and Pods having running or starting user vms.

New DAO helpers introduced:
HostPodDao: listByDataCenterIdVMTypeAndStates
DomainRouterDao: listByPodId and listByPodIdAndStates
VMInstanceDao: listByPodId and corrected definition of listByTypeAndState

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-10-11 19:33:26 +05:30
Alena Prokharchyk
823f0c9669 Fixed ipAssoc and createNetworkACL (for vpc) commands - didn't work in Project scenario
Conflicts:

	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
2012-10-09 16:26:26 -07:00
Alena Prokharchyk
fa81f27254 CLOUDSTACK-271: when check for vnet conflicts against existing physical networks, skip the networks with null vnet ranges 2012-10-05 15:10:31 -07:00
Murali Reddy
4e1f3f9410 CS-16426 For network offerings with IP conserved mode off, LB/PF/StaticNAT rule creation fails if the first rule is firewall
fixes, accidental modification of network services map object corresponding to a public IP
2012-10-03 17:18:00 -07:00
Alena Prokharchyk
11fe086ada Fixing CLOUDSTACK-226: don't allow physical networks with overlaping vnet ranges, belong to the same zone. Fixed create and update physical network code 2012-09-28 13:11:20 -07:00
Mice Xia
16c1fd9288 CLOUDSTACK-116 Guest Network created in a Sub Domain which doesn't have a network domain suffix, is assigned the network domain suffix of the zone instead of that of the Parent domain of the Sub domain 2012-09-17 21:23:41 +08:00
Alena Prokharchyk
d6b6529951 Revert "CLOUDSTACK-70: Improve Network Restart Behaviour for Basic Zone: Restarting Network Fails"
This reverts commit ecd1ac214c34007214557c4191a803a55ded29f5.
2012-09-10 16:34:21 -07:00
Rohit Yadav
ecd1ac214c CLOUDSTACK-70: Improve Network Restart Behaviour for Basic Zone: Restarting Network Fails
If cleanup=true, removes all VRs and creates VR, implements network.
If cleanup=false, skips running VRs, implements network for stopped/deleted VRs.

Signed-off-by: Rohit Yadav <rohit.yadav@citrix.com>
2012-09-10 14:13:24 +05:30
Alena Prokharchyk
51cc301fef CS-16222: send password reset command only to the element responsible for the userdata service in network
Reviewed-by: Sheng Yang
2012-09-04 13:41:10 -07:00
Prachi Damle
a08ae8e42c [ASFCS40]CS-15586: Public Vlan for an account fails in case of multiple Physical networks
Changes:
- Since Now a zone can have multiple physical networks, we need to find the physical network Id from the networkOffering's tag and zoneId and trafficType when we create a guest network

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
2012-08-23 18:18:12 -07:00
Prachi Damle
4bffd71d71 [ASFCS40]Db upgrade: merging changes from 303->304 upgrade to 3.0.2 -> 4.0 on master branch. 2012-08-21 16:27:54 -07:00
Alena Prokharchyk
2bf5c99bc6 CS-15304: VR deployment - release the lock for the network once the router entry is allocated (2.2.x behavior) as opposed to releasing it when the router start is completed
Reviewed-by: Frank Zhang

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
2012-08-21 15:31:07 -07:00
Alena Prokharchyk
7d0ad98c93 More logging to lock operations on the network 2012-08-21 15:25:17 -07:00
Sheng Yang
86d49e7aa0 CS-16060: Firewall service should be excluded from conserve mode checking 2012-08-17 17:05:04 -07:00
Sheng Yang
ea6f3eb6f9 CS-14253: Apply IP when firewall rule is in place 2012-08-17 16:52:06 -07:00
Sheng Yang
4cb7a100c6 Revert "bug 14484: Apply existed firewall rules when associating IP"
This reverts commit b409615a328c059ab8daf841529fcbf8abcb8863.

In order to fix CS-15503. Fix of bug 14484(CS-14253) would be applied later.
2012-08-17 16:52:06 -07:00
Alena Prokharchyk
71ead9ef4e VPC: CS-15925 - when vpc provider is speficied for a new network offering, no other providers can be used
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/test/com/cloud/network/MockNetworkManagerImpl.java
2012-08-13 14:03:39 -07:00
Alena Prokharchyk
d93c5d0531 VPC: CS-15950 - throw networkConflictException when try to create network rule for the ip address that is already in use for another service
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
2012-08-10 16:37:33 -07:00
Alena Prokharchyk
5c349dd5e5 Fixed NetworkManagerImpl - tabs weren't replaced with spaces in some places 2012-08-10 10:45:38 -07:00
Alena Prokharchyk
057d6ccbb8 Name change for vpc/Dao package (dao is lowercased now) 2012-08-08 14:51:51 -07:00
Alena Prokharchyk
048c5e50cf Merge branch 'master' into vpc
Conflicts:
	utils/test/com/cloud/utils/component/MockComponentLocator.java
2012-08-08 11:50:39 -07:00
Sheng Yang
46a12b378c CS-15243: Add service combination check at create network offering 2012-08-07 13:17:48 -07:00
Alena Prokharchyk
39485a4a56 VPC: CS-15821 - corrected mac address format for vpc private network 2012-08-02 18:07:15 -07:00
Alena Prokharchyk
ce9f1afa78 Merge branch 'master' into vpc
Conflicts:
	server/src/com/cloud/network/NetworkManagerImpl.java
2012-08-01 19:04:28 -07:00
Alena Prokharchyk
21e8fb372b VPC: CS-15805 - verify vpc guest network cidr only against networks in the same vpc
Conflicts:

	server/src/com/cloud/network/vpc/VpcManagerImpl.java
2012-08-01 19:02:43 -07:00
Alena Prokharchyk
1168747128 Fixed numerous bugs in listNetworks call related to filtering by projectId/listAll/domainId/etc. All the rules below are followed now:
1) When account/domainId or projectId are passed in:

* list all account specific networks of the account/project
* list all domain level networks from the domainId + subdomains if the targeted network has allowSubdomainAccess = true

In other words, we use all the networks that can be used for vm deployment by account/domainId.

If listAll is not specified in the request, account/domainId are being defaulted to the account/domainId of the caller
listAll is ignored if the call is being done by the regular user.

2) listAll is passed in by the Root admin, we list:

* all Account specific networks in the system
* all domain specific networks in the system

3) listAll is passed by the Domain admin, we list:

* All Account specific networks belonging to domain/subdomains of the domain admin.
* All domain specific networks belonging to domain/subdomains of the domain admin
* All domain specific networks allowing subdomain access belonging to the parent domain.

4) domainId - can be passed either with or without listAll. We list:

* all account specific networks belonging to the domain
* all domain specific networks of the domain
* all domain specific networks of the subdomains if isRecursive = true is passed in

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
2012-08-01 18:46:36 -07:00
Alena Prokharchyk
7cceaae912 VPC: moved vpc related code from NetworkManager to VpcManager
Conflicts:

	api/src/com/cloud/api/commands/AssociateIPAddrCmd.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/test/com/cloud/network/MockNetworkManagerImpl.java
2012-08-01 18:45:06 -07:00
Alena Prokharchyk
70713043cf VPC: CS-15774 - VPC and guest networks of VPC should belong to the same zone 2012-08-01 18:20:43 -07:00
Alena Prokharchyk
9be0a5525d VPC: CS-15725 - don't allow regular offering upgrade to the offering that can be used inside vpc only 2012-08-01 18:19:20 -07:00
Alena Prokharchyk
e0c85c0d41 VPC: replaced vmTo object with vmName parameter in plug/unplugNic commands 2012-08-01 18:19:03 -07:00
Alena Prokharchyk
7706a9c32f Merge branch 'master' into vpc
Conflicts:
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
2012-07-31 13:37:28 -07:00
Alena Prokharchyk
721d3ef3dc Fixed listNetworks to return domain level networks when listAll is passed to the request
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
2012-07-31 10:24:09 -07:00
Alena Prokharchyk
9ec89b9240 Allow EIP/ELB network creation only in Basic zone 2012-07-30 13:39:42 -07:00
Alena Prokharchyk
372568cb9a CS-15743: disable static nat as a part of network resources cleanup
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
2012-07-30 11:08:33 -07:00
Hugo Trippaers
236f63fd34 When cleaning up or setting ip associations the NiciraNvpElement should be ignored.
Implemented a generic ConnectivyProvider interface work around the dependency from server to nicira-plugin.
2012-07-30 15:17:35 +02:00