60 Commits

Author SHA1 Message Date
Sheng Yang
474d1a6034 bug 11307: Add destroyRouter command 2011-09-14 16:23:42 -07:00
Sheng Yang
684a603a6e bug 11307: Add cleanup parameter to restartNetwork command
Default set it to true. When cleanup=false, restartNetwork would only
re-implement the network, but don't destroy current existed routers.
2011-09-14 16:23:34 -07:00
alena
d3eb9db7fa bug 11204: when search for domR/dhcp, include Role to the corresponding search to eliminate getting "LB" network element in the response
status 11204: resolved fixed

Conflicts:

	server/src/com/cloud/network/element/VirtualRouterElement.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
2011-08-23 12:05:53 -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
Sheng Yang
9366290423 Fix NPE when a router is fail to start
Also enforce the check for restartNetworkCommand
2011-08-16 11:43:47 -07:00
Sheng Yang
b10f560be5 Fix NPE when a router is fail to start
Also enforce the check for restartNetworkCommand
2011-08-16 11:43:36 -07:00
Sheng Yang
bb6c2d48f5 bug 11122: Fix router startup
The new created router got hostId = 0.

status 11122: resolved fixed

Conflicts:

	server/src/com/cloud/network/element/VirtualRouterElement.java
2011-08-13 00:21:35 -07:00
Sheng Yang
08a2f30785 bug 11122: Fix router startup
The new created router got hostId = 0.

status 11122: resolved fixed
2011-08-13 00:15:53 -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
Sheng Yang
94f93a60c3 Clean up restart Network 2011-08-10 15:02:58 -07:00
Sheng Yang
18f2df44a1 Clean up restart Network 2011-08-10 15:02:08 -07:00
Sheng Yang
9569a7bbee Clean up VirtualRouterElement.restart() 2011-08-10 13:24:00 -07:00
Sheng Yang
bcf5058eda Clean up VirtualRouterElement.restart() 2011-08-10 13:23:30 -07:00
alena
4c4bff1c1e Fixed restarNetwork for networks of type Direct - was broken with checkin bfdb4d2d989ed00adcbbf5455731cc2980afcb7b 2011-08-09 15:51:57 -07:00
alena
2fef12e3ac Fixed the bug when domR was re-created as a part of implement() method in network gurus with sourceNatIp address belonging to incorrect user (System user instead of network owner).
Conflicts:

	server/src/com/cloud/network/element/DhcpElement.java
	server/src/com/cloud/network/element/VirtualRouterElement.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
alena
ae9ba8996a Fixed restarNetwork for networks of type Direct - was broken with checkin bfdb4d2d989ed00adcbbf5455731cc2980afcb7b 2011-08-08 21:33:34 -07:00
alena
c5502fb8aa Fixed the bug when domR was re-created as a part of implement() method in network gurus with sourceNatIp address belonging to incorrect user (System user instead of network owner). 2011-08-08 21:17:24 -07:00
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
alena
8d47c53735 Revert "bug 10435: removed vpn feature"
This reverts commit ea9e1b5d138950e8de49fce7ffdbb12a1c72c560.

Conflicts:

	api/src/com/cloud/api/ResponseGenerator.java
	scripts/vm/hypervisor/xenserver/vmops
	server/src/com/cloud/configuration/Config.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
2011-08-02 18:12:57 -07:00
Sheng Yang
8d2e41abd1 bug 10429: Enable redundant virtual router for 2.2.9
status 10429: resolved fixed
2011-07-19 15:06:20 -07:00
Sheng Yang
0449ba6c8c Fix restartNetwork command on destroying virtual router 2011-07-19 11:56:02 -07:00
Sheng Yang
aa8fc81790 Fix restartNetwork command on destroying virtual router 2011-07-19 11:55:16 -07:00
Sheng Yang
3100d4b22f Update RestartNetworkCmd to reimplment the network
Because the redundant router config may change.

Back port from 8c7c9a4b499ceee8a07f1f3a2b908d4a128aef32 partly.
2011-07-19 10:53:21 -07:00
Sheng Yang
978b2640e2 Backport VirtualNetworkApplianceManager
Also:
1. Discard VPN related change.
2. Add network.dns.basiczone.updates in Config.java
3. Add findByNetworkOutsideThePod() for DomainRouterVO

Tested with VLAN and basic mode, works.

Disable redundant virtual router temporaily, would enable it after more testing.
2011-07-18 18:30:05 -07:00
Sheng Yang
4bc8686513 bug 10429: Backport redundant virtual router
Part 1

This backport contained:

commit 52317c718c25111c2535657139b541db0c9d1e1f
    bug 9154: Initial check in for enabling redundant virtual router

commit 54199112055d754371bfb141168fb5538bf6d6ea
    Add host verification for CheckRouterCommand

commit cef978a228c90056ead9be10cbc4de74c2b8de76
    Fix CheckRouterAnswer's isMaster report

commit 4072f0a6991ac3b63601a1764fbe14188965f62f
    Some build fixes and code refactoring for redundant router

commit 4d3350b7cd8ee2706a9bace4437fc194e36c8dd5
    Redundant Router: Fix OVS

commit 6a228830e7c46d819fa0c3317e159e041337e887
    Fix findByNetwork()/findByNetworkAndPod()'s return

commit c627777b3d5bdbcd60db4032cebd349a5b1ecd83
    Redundant Router: Fix isVmAlive()

commit e1275d2514adc41f8744f5107d4069c38be195f1
    Only issue CheckRouterCommand to redundant routers

And all modification to the scripts till
commit 4e3942462ed3fde3a3d7011e95839e2128fba514
logging changes

in the master branch.
2011-07-18 18:29:56 -07:00
alena
0d84cde633 bug 10409: added domainSuffix parameters to account/domain objects 2011-07-15 14:40:39 -07:00
alena
21afc889d0 bug 10438: always return success on disableAccount when it got disabled successfully in the DB. If his vms failed to stop on the backend, mark account for cleanup and let background thread to do the cleanup job
status 10438: resolved fixed
2011-07-15 14:27:58 -07:00
kishan
b8a19e73af bug 6128: Throw exception when applying port forwarding rule fails
status 6128: resolved fixed
2011-07-12 16:41:17 +05:30
alena
50dce6d5a0 bug 10438: always return success on disableAccount when it got disabled successfully in the DB. If his vms failed to stop on the backend, mark account for cleanup and let background thread to do the cleanup job
status 10438: resolved fixed
2011-07-11 17:45:50 -07:00
alena
74f34a0e0c bug 10435: removed vpn feature
status 10435: resolved fixed
2011-06-24 09:18:46 -07:00
Sheng Yang
6e405efe01 bug 10311: Update UpdateNetworkCmd, allow change networkOfferingId
And restart/re-implement the network if networkOfferingId is changed.
2011-06-22 15:30:39 -07:00
Sheng Yang
be216bf975 bug 9154: Add redundancy capability to VirtualRouterElement
Also move redundancy checking to VirtualRouterElement
2011-06-20 14:47:22 -07:00
Sheng Yang
470c80a2c6 bug 9154: Update addVirtualMachineIntoNetwork to accept routers as parameter 2011-06-20 14:47:22 -07:00
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
Sheng Yang
872116890b Fix findByNetwork()/findByNetworkAndPod()'s return
Add null check and some missed empty check.
2011-06-08 11:45:42 -07:00
Sheng Yang
62ac899091 bug 9154: Initial check in for enabling redundant virtual router
This patch enable redundant virtual routers.

1. To enable this feature, db need to be updated using follow SQL by now(we
would get a UI way later):

UPDATE network_offerings SET redundant_router=1 WHERE guest_type="Virtual" AND
system_only=0;

2. System would try to start up two routers at different hosts. But if there is
only one host in the zone, system would start up two routers on it.

3. The failover part is using keepalived, and connection tracking part is using
conntrackd. There would be one master router and one backup router. The status
of router(master or backup) can be query from the database table domain_router
now. Management server would update the status every 30s by default.

4. The routers for the same zone would use same external NIC(same ip and mac).
The script used for fail-over would ensure only one external NIC present in the
network at any time.

5. Currently management server don't got the ability to stop one of router is
both of them reported as master. The feature is in the todo list.

After two routers start up, disconnect anyone of them, the guest network
shouldn't be affected, and established connection(http, ssh, etc.) should still
works. The fail-over on gateway part should be 3~4 seconds.

Currently the patch works with KVM. Would deal with vmware and XenServer soon.
2011-06-07 14:47:45 -07:00
alena
f395005e0a bug 8781: set dhcp/dns/userData providers to be DhcpServer in Basic zone; all other providers have to be null
status 8781: resolved fixed
2011-03-01 09:00:47 -08:00
alena
c11a9c18e2 bug 8381: disassociateIpAddress is async now 2011-02-15 12:24:18 -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
Alex Huang
b92fc074aa added forced paramter to stop apis 2011-02-08 15:38:26 -08:00
Alex Huang
b322fb072f bug 8186: Changed the investigator to use the new networking 2011-02-07 16:04:23 -08:00
alena
6544820e74 Moved networkRestart to the NetworkManager as it's up to the manager (not network elements) to decide what to do on restart (IpAssoc/ruleApply/etc..) 2011-02-01 12:16:19 -08:00
alena
f6f8a35c75 bug 8251: introduced "id" field for public IP address. In the DB id is a primary key in user_ip_address table; ip_address and source_network_id is a composite key
status 8251: resolved fixed
2011-02-01 12:16:18 -08:00
alena
52dd679d95 bug 8185: fixed java part of password reset feature. There are still changes needed in backend scripts (bugs 8253 and 8254 are filed separately)
status 8185: resolved fixed
2011-01-27 17:24:09 -08:00
alena
3a008ee699 Changed restartNetwork command flow:
* API requires network id to be passed in (it was optional before)
* restartNetwork calls restart() method of all network elements in the system, and it's up to the element to decide which actions to take on the restart (for example, for Virtual Router it's IPAssoc/applyPF/applyLBRules).
2011-01-24 18:37:57 -08:00
Alex Huang
2466589e2f removed unused domain_router_id from uservm 2011-01-24 16:56:00 -08:00
alena
632d3c67f1 bug 6689: release source nat ip address as a part of domR/dhcp destroy
status 6689: resolved fixed

Changes to destroyNetwork process. Here are the steps:
* shutdown network - shutdowns all network elements (domRs/Dhcps)
* delete network - destroy all network elements, cleanup network's resources (vlans, ip ranges), mark network with Destroyed state and set Removed field
2011-01-18 19:31:04 -08:00
Kelven Yang
256e26ff61 Waiting virtual router to be ready in a outer place instead of inside VirtualNetworkApplianceImpl. This is to fix the the blocker issue of unable to deploy VM/start DomR 2011-01-12 12:31:19 -08:00