94 Commits

Author SHA1 Message Date
alena
a1cab92ae1 bug 11537: revoke related FirewallRules when do vmExpunge and ipAddress release.
status 11537: resolved fixed

Reviewed-by: edison@cloud.com

Conflicts:

	server/src/com/cloud/network/firewall/FirewallManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
2011-09-22 14:01:02 -07:00
alena
a1331d1cfc Intermidiate checkin to Project feature:
1) Introduce new managers - ProjectManager and DomainManager. Moved all domain related code from AccountManager to DomainManager.
2) Moved some code from ManagementServerImpl to the correct managers.
3) New resource limit for Domain - Project
2011-09-20 18:35:28 -07:00
alena
8c53dbcdd7 bug 11185: support multiple CIDR on overlapping port ranges for firewall rules
status 11185: resolved fixed

Conflicts:

	server/src/com/cloud/network/firewall/FirewallManagerImpl.java

Conflicts:

	api/src/com/cloud/network/firewall/FirewallService.java
	server/src/com/cloud/network/firewall/FirewallManagerImpl.java
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
2011-08-25 12:21:11 -07:00
alena
e3f179844e bug 11236: domainAdmin/regularUser can edit/delete/copy/extract Public template/iso only if it was created by them. They still can use/see public template/iso when execute list/deploy/attachIso commands. Root admin can operate with other people templates w/o any restrictions.
status 11236: resolved fixed
2011-08-24 14:48:35 -07:00
alena
8a7feb8ec1 Merge branch '2.2.y'
Conflicts:
	agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java
	api/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java
	api/src/com/cloud/agent/api/to/FirewallRuleTO.java
	api/src/com/cloud/agent/api/to/IpAddressTO.java
	api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
	api/src/com/cloud/api/ApiConstants.java
	api/src/com/cloud/api/BaseCmd.java
	api/src/com/cloud/api/ResponseGenerator.java
	api/src/com/cloud/api/commands/CreateFirewallRuleCmd.java
	api/src/com/cloud/api/commands/CreateIpForwardingRuleCmd.java
	api/src/com/cloud/api/commands/CreateLoadBalancerRuleCmd.java
	api/src/com/cloud/api/commands/CreatePortForwardingRuleCmd.java
	api/src/com/cloud/api/commands/DeleteLoadBalancerRuleCmd.java
	api/src/com/cloud/api/commands/ListCapabilitiesCmd.java
	api/src/com/cloud/api/commands/UpdateNetworkCmd.java
	api/src/com/cloud/api/response/CapabilitiesResponse.java
	api/src/com/cloud/network/Network.java
	api/src/com/cloud/network/NetworkService.java
	api/src/com/cloud/network/firewall/FirewallService.java
	api/src/com/cloud/network/lb/LoadBalancingRule.java
	api/src/com/cloud/network/lb/LoadBalancingRulesService.java
	api/src/com/cloud/network/rules/FirewallRule.java
	api/src/com/cloud/network/rules/RulesService.java
	api/src/com/cloud/offering/NetworkOffering.java
	client/tomcatconf/commands.properties.in
	cloud.spec
	core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
	core/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
	core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
	core/src/com/cloud/storage/template/DownloadManagerImpl.java
	core/src/com/cloud/vm/DomainRouterVO.java
	debian/cloud-deps.install
	patches/systemvm/debian/config/etc/init.d/cloud-early-config
	patches/systemvm/debian/config/root/ipassoc.sh
	patches/systemvm/debian/config/root/loadbalancer.sh
	scripts/vm/hypervisor/kvm/rundomrpre.sh
	scripts/vm/hypervisor/xenserver/vmops
	server/src/com/cloud/agent/manager/AgentAttache.java
	server/src/com/cloud/agent/manager/AgentManagerImpl.java
	server/src/com/cloud/agent/manager/AgentMonitor.java
	server/src/com/cloud/agent/manager/ClusteredAgentManagerImpl.java
	server/src/com/cloud/alert/ClusterAlertAdapter.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/cluster/ClusterManagerImpl.java
	server/src/com/cloud/configuration/Config.java
	server/src/com/cloud/configuration/ConfigurationManager.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/deploy/FirstFitPlanner.java
	server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
	server/src/com/cloud/host/dao/HostDaoImpl.java
	server/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
	server/src/com/cloud/network/LoadBalancerVO.java
	server/src/com/cloud/network/NetworkManager.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/dao/FirewallRulesDao.java
	server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
	server/src/com/cloud/network/element/DhcpElement.java
	server/src/com/cloud/network/element/VirtualRouterElement.java
	server/src/com/cloud/network/firewall/FirewallManagerImpl.java
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/network/rules/FirewallManager.java
	server/src/com/cloud/network/rules/FirewallRuleVO.java
	server/src/com/cloud/network/rules/PortForwardingRuleVO.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/network/rules/StaticNatRuleImpl.java
	server/src/com/cloud/network/security/SecurityGroupListener.java
	server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
	server/src/com/cloud/offerings/NetworkOfferingVO.java
	server/src/com/cloud/server/ConfigurationServerImpl.java
	server/src/com/cloud/server/ManagementServerImpl.java
	server/src/com/cloud/storage/StorageManager.java
	server/src/com/cloud/storage/StorageManagerImpl.java
	server/src/com/cloud/storage/dao/VMTemplateHostDaoImpl.java
	server/src/com/cloud/storage/download/DownloadMonitorImpl.java
	server/src/com/cloud/upgrade/DatabaseUpgradeChecker.java
	server/src/com/cloud/upgrade/dao/Upgrade228to229.java
	server/src/com/cloud/upgrade/dao/Upgrade229to2210.java
	server/src/com/cloud/user/AccountManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	server/src/com/cloud/vm/VirtualMachineManagerImpl.java
	server/src/com/cloud/vm/dao/DomainRouterDao.java
	server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
	setup/db/create-index-fk.sql
	setup/db/create-schema.sql
	setup/db/db/schema-222to224.sql
	setup/db/db/schema-227to228.sql
	setup/db/db/schema-228to229.sql
	setup/db/db/schema-229to2210.sql
	tools/testClient/README
	ui/scripts/cloud.core.instance.js
	utils/src/com/cloud/utils/SerialVersionUID.java
	utils/src/com/cloud/utils/db/ConnectionConcierge.java
	utils/src/com/cloud/utils/db/Merovingian2.java
	utils/src/com/cloud/utils/db/Transaction.java
	utils/src/com/cloud/utils/nio/Link.java
	utils/src/com/cloud/utils/nio/NioConnection.java
	utils/src/com/cloud/utils/time/InaccurateClock.java
2011-08-22 20:28:30 -07:00
alena
05713a20e8 bug 11114: when release static nat as a part of vm expunge, do searchIncludingRemoved in nics table as the nics are marked as Removed before static nat is released
status 11114: resolved fixed
2011-08-15 10:18:45 -07:00
alena
d8a9612ef7 Remove firewall rule along with pf/staticNat/lb rule if the pf/staticNat/lb failed to create due to network rule conflict 2011-08-15 10:18:44 -07:00
alena
803255b0ba bug 11029: db upgrade from 2.2.9 to 2.2.10 includes firewall_rule upgrade now
status 11029: resolved fixed

Commit also includes the following:

* map firewall rule to pf/lb/staticNat/vpn when the firewall rule is created as a part of pf/lb/staticNat/vpn rule creation
* when delete firewall rules, also delete related firewall rule
2011-08-15 10:18:09 -07:00
Chiradeep Vittal
51af0db682 mass merge 2.2.10 2011-08-11 16:41:52 -07:00
alena
5080e8ba33 No need to apply static nat for ip which is not static nat enabled 2011-08-11 16:00:16 -07:00
alena
477e5d6389 bug 10561: reapply static nat on the backend as a part of domR restart and network restart 2011-08-11 11:19:09 -07:00
alena
278f2a401f bug 10561: intermediate checkin for enable/disableStaticNat.
1) On enableStaticNat command we actually send the command to the backend (we used to just upgrade the DB in the past). The backend command carries sourceIp and destIp, and creates IP to IP mapping on the domR.
2) On disableStaticNat for the Ip address in addition to cleaning up port ranges, we also delete IP to IP mapping on the domR.
2011-08-11 10:19:22 -07:00
alena
fe3dd44bec ICMP protocol is supported in createFirewallRule command only; throw an error if specified in createPF/StaticNat/LB rule 2011-08-10 12:56:25 -07:00
alena
32b53351ff Fixed response processing in createFirewallRule command 2011-08-10 11:36:34 -07:00
Abhinandan Prateek
949ad3f4c4 bug 10561: readding source cidr changes to firewall rules 2011-08-10 13:55:37 +05:30
Abhinandan Prateek
9bba09857e bug 10561: readding source cidr changes to firewall rules 2011-08-10 13:52:42 +05:30
alena
56d5054e39 Revert "bug 10561: Allowing ICMP traffic through static NAT"
This reverts commit 5e74e24bb359456967866cb2c6cc0f6f73570f97.

Conflicts:

	server/src/com/cloud/network/rules/RulesManagerImpl.java
2011-08-09 15:51:57 -07:00
alena
6b9603bc4c bug 10561: intermidiate checkin for FirewallRuleFeature
1) Added new apis: createFirewallRule, deleteFirewallRule, listFirewallRules
2) Modified existing apis - added boolean openFirewall parameter to createPortForwardingRule/createIpForwardingRule/createRemoteAccessVpn. If parameter is set to true, open firewall on the domR before creating an actual PF rule there
Modified backend calls appropriately.
3) Schema changes for firewall_rules table:
* startPort/endPort can be null now
* added icmp_type, icmp_code fields (can be not null only when protocol is icmp)
4) Added new manager - FirewallManagerImpl

Conflicts:

	api/src/com/cloud/api/BaseCmd.java
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
2011-08-09 15:51:56 -07:00
Abhinandan Prateek
311afeae23 bug 10731: reverting back source cidr changes for loadbalancer and portforwarding 2011-08-09 16:01:48 +05:30
alena
06d007337a bug 10561: intermidiate checkin for FirewallRuleFeature
1) Added new apis: createFirewallRule, deleteFirewallRule, listFirewallRules
2) Modified existing apis - added boolean openFirewall parameter to createPortForwardingRule/createIpForwardingRule/createRemoteAccessVpn. If parameter is set to true, open firewall on the domR before creating an actual PF rule there
Modified backend calls appropriately.
3) Schema changes for firewall_rules table:
* startPort/endPort can be null now
* added icmp_type, icmp_code fields (can be not null only when protocol is icmp)
4) Added new manager - FirewallManagerImpl
2011-08-08 20:59:40 -07:00
Naredula Janardhana Reddy
9e9ae52dbf Revert "bug 10561: Allowing ICMP traffic through static NAT"
This reverts commit 5e74e24bb359456967866cb2c6cc0f6f73570f97.
2011-08-09 00:08:07 +05:30
Naredula Janardhana Reddy
46427fef91 bug 10561: Allowing ICMP traffic through static NAT 2011-08-03 21:15:02 +05:30
Naredula Janardhana Reddy
954d8673c7 bug 10561: Allowing ICMP traffic through static NAT 2011-08-03 18:13:09 +05:30
kishan
ddd416a492 bug 10382: wrapped usage events in txn 2011-07-20 11:19:39 +05:30
kishan
fd6900a3d8 bug 10382: wrapped usage events in txn 2011-07-01 18:11:56 +05:30
alena
53bdd625b8 bug 9579: allow domain name suffix update for existing networks.
Block update only in these cases:

* when DNS capability AllowDnsSuffixModification is false for the network
* when target network has running network elements (dhcps or domRs)

Conflicts:

	server/src/com/cloud/vm/dao/DomainRouterDao.java
	server/src/com/cloud/vm/dao/DomainRouterDaoImpl.java
2011-06-09 16:24:48 -07:00
alena
b9325a28dd bug 9579: allow domain name suffix update for existing networks.
Block update only in these cases:

* when DNS capability AllowDnsSuffixModification is false for the network
* when target network has running network elements (dhcps or domRs)
2011-06-09 16:10:24 -07:00
Alex Huang
d9e0bcfa1e bug 10126: Renamed getPodId() to getPodIdToDeployIn() 2011-06-03 22:17:08 -07:00
Murali Reddy
5769fde46b bug 7194:New API for adding range of public & private ports in port forwarding rule addition
adding support for port ranges in port forwarding rules.
2011-05-19 18:32:09 +05:30
Abhinandan Prateek
d752a94838 bug 8115: Source IP filtering in Virtual Router
Passing the additional source cidrs paramter to the xapi.
2011-05-12 13:37:43 +05:30
Abhinandan Prateek
2984b0607f bug 8115: source ip filtering
Created a table for source cidrs list.
Created necessary Daos and VOs.
Updated PortForwardingRulesDao to persist/update non null list of cidrs.
For deletion depending on ON DELETE CASCADE.
2011-05-09 17:41:50 +05:30
kishan
76a30cc76f bug 9686,9676,9677: Create usage events for existing resources for port forwarding, load balancer and network offering usage
status 9686,9676,9677: resolved fixed
2011-05-03 20:01:28 +05:30
alena
1a6d78eae4 Code cleanup. No need to declare runtime exceptions (CloudRuntimeException, InvalidParameterException, PermissionDenied exceptions) 2011-04-21 16:26:53 -07:00
alena
98baa7392e bug 9383: createStaticNat rule - allow opening the same port for tcp/udp traffic
status 9383: resolved fixed
2011-04-18 17:55:41 -07:00
Frank
105db3b15a Merge branch 'baremetal' to master
modifies:
	api/src/com/cloud/api/ApiConstants.java
	api/src/com/cloud/api/commands/AddHostCmd.java
	api/src/com/cloud/api/commands/CreatePodCmd.java
	api/src/com/cloud/api/commands/DeployVMCmd.java
	api/src/com/cloud/dc/Pod.java
	api/src/com/cloud/network/NetworkService.java
	server/src/com/cloud/agent/manager/AgentManagerImpl.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	server/src/com/cloud/dc/HostPodVO.java
	server/src/com/cloud/network/NetworkManager.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	setup/db/create-schema.sql
	utils/src/com/cloud/utils/SerialVersionUID.java
2011-04-11 14:21:41 -07:00
nit
debe236a8d bug 8710: CONTD....Introducing a new user role in cloudstack called RESOURCE_DOMAIN_ADMIN. The role would have all the domain_admin rights and the rights to list zone,pods,clusters and so on. More info in the bug 2011-04-11 19:40:37 +05:30
alena
7ce9845fb7 No need to check if user vm exists during static nat port range creation. We already do it when enableStaticNat for the ip address 2011-03-29 13:46:18 -07:00
alena
96e83fe97f bug 8146: Elastic IP support in Basic zone.
Following was done as a part of checkin:

1) NetworkOffering/Network:

* add PF service support for default Guest network offering.
* Add one more additional network - Public.
* Allow to enable external firewall in Basic zone.

2) Don't allow to deployVm in Public Network.
3) Allow to add vlan ip ranges to Public networks in Basic zone.
4) Associate IP - allow to associate with Direct vms.
5) Allow to create PF/Static nat rules. Rules are being sent to External Firewall Rule only.
6) Add PF support to External Firewall element.
2011-03-17 17:19:36 -07:00
alena
95faeb620e bug 8863: generate usage event when PF/LB/StaticNat rule is set with Revoke status, not when it's actually removed on the backend.
status 8863: resolved fixed
2011-03-16 09:41:50 -07:00
alena
a8e70cf9b4 bug 8763: Fixed account cleanup process - don't destroy networks when vm expunge failed
status 8763: resolved fixed

Conflicts:

	server/src/com/cloud/user/AccountManagerImpl.java
2011-03-01 14:25:09 -08:00
alena
62b3d548d6 bug 8753: never release public Ip address without ensuring that all corresponding resources (PF/StaticNat/Lb rules) are cleaned up.
Fixed couple of other problems along:

* when expunge PF/Static nat rules as a part of vmExpunge/IpRelease process, first mark all rules as Revoke, and then send commands to the backend. Group commands by Ip address.
Before we used to do Revoke/Send per rule basis.
* When release source nat rule, make sure that corresponding vpn (if exists) is being expunged.
2011-02-28 09:21:05 -08:00
alena
f8993d9ec4 Fixed NPE in vm expunge process - when cleanup static nat rules after corresponding vm is expunged, make search for guest Nic including removed. 2011-02-24 18:27:55 -08:00
alena
b0aabc1b20 bug 8682: implemented search by id in listPortForwardingRules
status 8682: resolved fixed
2011-02-24 09:55:03 -08:00
alena
8978839d96 bug 8617: Disable firewall/lb/vpn service for Direct network offering, so when user tries to create PF/LB rule for direct IP address, it fails.
status 8617: resolved fixed
2011-02-17 14:31:05 -08:00
alena
42ddf74bc5 bug 8284: don't allow to create static nat rules for 2 different ip addresses and the same vm.
status 8284: resolved fixed
2011-02-15 13:52:00 -08:00
alena
9c2db92b63 Fixed the bug when port forwarding rules were not reset correctly on domR restart/start (multiple public ip addresses case) 2011-02-15 10:49:46 -08:00
alena
d80caf24fd bug 8564: Changed implementation for static nat rules. Now we use separate interfaces instead of PortForwardingRules interfaces.
status 8564: resolved fixed
2011-02-15 10:45:28 -08:00
alena
8cd7426dd0 bug 8455: for static nat port range don't allow start port to be bigger than end port
status 8455: resolved fixed
2011-02-11 17:43:56 -08:00
alena
0938509bc0 bug 7341: introduced search by id/vmId to listIpForwardingRules command
status 7341: resolved fixed
2011-02-11 17:14:34 -08:00
kishan
2a6bef2750 seperating service API call form internal calls for revoke port forwarding rule 2011-02-08 12:34:04 +05:30