656 Commits

Author SHA1 Message Date
Kelven Yang
2c5859dbd4 Bring javelin back to the status of being able to start System VMs after another round of master branch merge 2013-01-18 19:15:32 -08:00
Alex Huang
10d9c019a9 All merge conflicts resolved 2013-01-18 12:14:57 -08:00
Chiradeep Vittal
cadca5fc0c Merge branch 'master' into network-refactor-merge2
Conflicts:
	api/src/com/cloud/network/NetworkService.java
	api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java
	plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java
	server/src/com/cloud/acl/DomainChecker.java
	server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
	server/src/com/cloud/network/NetworkManager.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	server/test/com/cloud/network/MockNetworkManagerImpl.java
	server/test/com/cloud/vpc/MockNetworkManagerImpl.java
2013-01-16 19:17:14 -08:00
Murali Reddy
c7840cf91f reverting the earlier commit 432ea9c7d4aff3f7e682f2951f49ed3e95778d9f
done for bug CLOUDSTACK-265 due to IP clearence issues.
2013-01-16 15:10:27 +05:30
Alex Huang
fac2270240 more files changed 2013-01-10 15:29:14 -08:00
Alex Huang
56e5fbdee2 removed import of componentlocator and inject from all files 2013-01-10 11:44:47 -08:00
Kelven Yang
0bcebd33b6 Fix problems after merge 2013-01-09 17:36:53 -08:00
Chiradeep Vittal
504264236c Network-refactor: In preparation for moving the read-only interface NetworkModel
to the api project, ensure that all methods use interfaces from the api project.
By moving it to the api project, it lessens the dependency of plugins on the server components.

Signed-off-by: Chiradeep Vittal <chiradeep@apache.org>
2013-01-09 15:49:01 -08:00
Chiradeep Vittal
5a830c4db0 Network-refactor: Refactor NetworkManager into NetworkModel and NetworkManager.
NetworkManager's exclusive focus is now
 - handling plugins during orchestration, and
 - to deal with ip address allocation.
Those classes that used to refer to NetworkManager to get access to the datamodel now refer to NetworkModel

Signed-off-by: Chiradeep Vittal <chiradeep@apache.org>
2013-01-09 15:49:01 -08:00
Alex Huang
0bcb64605f all built with the latest 2013-01-09 05:02:39 -08:00
Alex Huang
14bd345f1f merge compiles 2013-01-09 04:41:27 -08:00
Kelven Yang
cc23a23324 Fix startup sequence for classes that have due Manager/Adapter interfaces 2013-01-08 18:42:12 -08:00
Kelven Yang
b274c570f9 Cleanup places that use explicit wiring of the components 2013-01-08 17:45:33 -08:00
Alex Huang
30f2565d98 Merge branch 'api_refactoring' into javelin 2013-01-08 12:36:04 -08:00
Prachi Damle
a4f4c98670 OrchestrationService: some changes for DeployVM 2013-01-08 11:53:54 -08:00
Rohit Yadav
39b829bffe api: ACL annotation and checkAccess removal refactor for StopVMCmd
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 17:19:49 -08:00
Rohit Yadav
ed0637b8c2 api: Refactor move acl to org.apache.cloudstack
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-06 15:30:58 -08:00
Rohit Yadav
296b49c2f8 Merge branch 'master' into test-merge-api
Conflicts:
	api/src/com/cloud/agent/api/BackupSnapshotCommand.java
	api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
	api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
	api/src/com/cloud/network/NetworkService.java
	api/src/com/cloud/resource/ResourceService.java
	api/src/org/apache/cloudstack/api/ApiConstants.java
	api/src/org/apache/cloudstack/api/ResponseGenerator.java
	api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
	client/tomcatconf/commands.properties.in
	core/src/com/cloud/storage/SnapshotVO.java
	pom.xml
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/offerings/NetworkOfferingVO.java
	server/src/com/cloud/resource/ResourceManagerImpl.java
	server/src/com/cloud/upgrade/dao/Upgrade40to41.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	server/test/com/cloud/vpc/MockNetworkManagerImpl.java
	setup/db/create-schema.sql
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-23 13:54:46 -08:00
Marcus Sorensen
6ed1989133 Summary: Allow for custom storage adaptors based on pool type in KVM
Detail: Instead of using LibvirtStorageAdaptor for everything, you can create
your own storage adaptor and use it. We select storage adaptor based on storage
pool type, thus we needed to adjust LibvirtComputingResource to pass pool type
to everything in KVMStoragePoolManager. This in turn required that we pass the
info necessary to LibvirtComputingResource as well, so a few agent Commands were
modified.

Note this patch in and of itself shouldn't change any existing behavior, just
allow for new storage adaptors to be selected based on storage pool type.

Reviewed-by: Edison Su
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1355769696 -0700
2012-12-17 11:41:36 -07:00
Min Chen
c167ad45e3 Move view based VO and Dao classes to cloud-server module to hide the
details from API client, also extract query related methods into
QueryService interface.
2012-12-14 10:47:58 -08:00
Simon Waterhouse
0ba355fbc2 CLOUDSTACK-284: listVirtualMachines when zoneid passed
When zoneid is passed an no state is specified listVIrtualMachines does
not return the destroyed vms. This patch fixes the issue.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-13 23:06:07 -08:00
Rohit Yadav
88b7af18e6 api: Revert "Move all the DB view DAOs from cloud-server to cloud-api for future api-server package."
Reverting commit as we don't want the daos to move to cloud-api.
We'll eventually breakout cloud-server and create cloud-api-server for the standalone
api server.

This reverts commit 7597a38f7a255e49b73c833918f30b51504e0c53.
2012-12-13 09:42:28 -08:00
Min Chen
7597a38f7a Move all the DB view DAOs from cloud-server to cloud-api for future api-server package.
BUG-ID: CLOUDSTACK-527

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-13 09:28:42 -08:00
Murali Reddy
432ea9c7d4 CLOUDSTACK-265: provide option to turn-off automatic public IP association for each VM when using EIP service.
- introduces Capability in the network offering, which
    decides when EIP service is enabled, by defualt public IP
    should be assigned to the VM or not

  - default network offering with EIP/ELB service will still work with old EIP
    semantics, i.e) assign a public IP to each VM on start
2012-12-11 23:06:13 +05:30
Koushik Das
238c55fb6e CLOUDSTACK-596 : DeployVM command takes a lot of time to return job id Issue happens while deploying VM in advanced zone and 'networkids' parameter is not passed to deployVM command. In this case CS tries to identify a default guest network to be used for deploying VM. This logic is not optimized and latency increases with increase in user accounts and guest networks. Optimized logic for getting default network.
Signed-off-by: Koushik Das <koushik.das@citrix.com>
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
2012-12-10 15:02:53 +05:30
Rohit Yadav
e398b1e47a api: Refactor command and response classes to org.apache.cloudstack.api.*
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-07 19:23:24 -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
Min Chen
b0ce8fd4ff api: Optimize and improve api, db call perfomance
This is part 1 of list API refactoring. Commands covered:
listVmsCmd, listRoutersCmd Response covered:
UserVmResponse, DomainRouterResponse. DB views created:
user_vm_view, domain_router_view.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-05 20:06:20 -08:00
Rohit Yadav
8773fc2a55 api_refactor: refactor volume apis
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-04 11:20:48 -08:00
Rohit Yadav
46353e0916 api_refactor: refactor vmgroup apis
- Fix refactored apis, fix mappings in commands*.in
- Fix comments etc.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-03 23:35:30 -08:00
Rohit Yadav
3e0b2164be api_refactor: refactor template apis
- Fix refactored apis, fix mapping in commands*.in
- Fix comments etc.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-03 23:05:44 -08:00
Rohit Yadav
6fc3bc3760 api_refactor: refactor vpn and vm apis
- Refactor VPN and VM APIs to admin and user pkgs
- Names space, org.apache.cloudstack
- Fix refactored apis in commands*.in
- Fix comments etc.
- Expand tabs, remove trailing whitespace

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-03 21:27:02 -08:00
Alena Prokharchyk
7857b1f62a CLOUDSTACK-573: check if external provider enabled, only when finalize the service/provider list for the network 2012-11-30 13:07:01 -08:00
Alena Prokharchyk
1aa4ad6a3c CLOUDSTACK-572: Advance SG enabled zone - allow deploying vm in SG disabled Account specific networks
Conflicts:

	server/src/com/cloud/vm/UserVmManagerImpl.java
2012-11-30 12:47:37 -08:00
Rohit Yadav
55447c2572 CLOUDSTACK-424: Fix NPE while updating user data
Replace newlines in userdata only when it's not null.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-11-21 18:27:11 +05:30
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
Alena Prokharchyk
6d9cafbf35 DeployVm: when SG enabled network is passed to the command, but no SG list is defined in the request, add the vm to SG enabled network automatically
Conflicts:

	server/src/com/cloud/vm/UserVmManagerImpl.java
2012-11-14 15:01:35 -08:00
Kelven Yang
cea8f3bf37 Switch inject annotation to javax and let ComponentLocator to recognize both the new and original inject annotation 2012-11-07 15:03:22 -08:00
Kelven Yang
aab02e2743 Add Spring annotation to major components 2012-11-07 14:53:39 -08:00
Alena Prokharchyk
8f2d9a09e5 CLOUDSTACK-332: intermediate checkin fixing count parameter in listCommands
Fixes the count in commands:

listVolumes
listVirtualMachines
listSnapshots
listRouters
listFirewallRules
listPortForwardingRules
listLoadBalancerRules
listIpForwardingRules
listAccounts
listUsers
listDomains
listDomainChildren
listPublicIpAddresses
listAlerts
listAsyncJobs
listRemoteAccessVpns
listVpnUsers
listTags
listPrivateGateways
listNetworkACLs
listStaticRoutes

Conflicts:

	api/src/com/cloud/api/commands/ListVMsCmd.java
	api/src/com/cloud/api/commands/ListVolumesCmd.java
	api/src/com/cloud/network/lb/LoadBalancingRulesService.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
	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java
	server/src/com/cloud/tags/TaggedResourceManagerImpl.java
2012-10-12 13:58:59 -07:00
Marcus Sorensen
3c25d0ea67 CLOUDSTACK-202 Can't create VM from ISO, when in VPC
Signed-off-by: Mice Xia <mice_xia@tcloudcomputing.com>
2012-09-27 10:07:15 +08:00
Mice Xia
55bcfaf805 CLOUDSTACK-88 Cannot listVM by vpcId which is required by VPC UI 2012-09-13 11:21:11 +08:00
Likitha Shetty
cc80d09d77 CS-14796: Error out with InvalidParameterValueException in UserVmManagerImpl if userdata is not base64 encoded. 2012-09-11 16:58:09 -07:00
Koushik Das
65eeeaf071 CS-14277
Support for local data disk. Currently enable/disable config is at zone level, in subsequent checkins it can be made more granular.
    Following changes are made:
    - Create disk offering API now takes an extra parameter to denote storage type (local or shared). This is similar to storage type in service offering.
    - Create/delete of data volume on local storage
    - Attach/detach for local data volumes. Re-attach is allowed as long as vm host and data volume storage pool host is same.
    - Migration of VM instance is not supported if it uses local root or data volumes.
    - Migrate is not supported for local volumes.
    - Zone level config to enable/disable local storage usage for service and disk offerings.
    - Local storage gets discovered when a host is added/reconnected if zone level config is enabled. When disabled existing local storages are not removed but any new local storage is not added.
    - Deploy VM command validates service and disk offerings based on local storage config.
    - Upgrade uses the global config 'use.local.storage' to set the zone level config for local storage.
(cherry picked from commit 62710aed37606168012a0ed255a876c8e7954010)
2012-09-11 17:22:43 +05:30
Edison Su
24fa14845b Add KVM to hypervisor types allowed in VPC
RB: https://reviews.apache.org/r/6926/
Send-by: Marcus Sorensen
2012-09-07 15:39:23 -07:00
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
olivier lamy
0d9b81aac6 that was an unused import not a missing dependency 2012-08-25 00:44:14 +02: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
Abhinandan Prateek
3298a481a8 For assignVM, marking older snapshots removed in db 2012-08-23 12:22:02 +05:30
Alena Prokharchyk
3ada5e4a46 VPC: CS-16100 - 1) when start VPC router, never pick up any other hypervisor besides vmWare and Xen 2) When start user vm in vpc network, throw an error when deploy from the tempalate of not supported hypervisor
Reviewed-by: Frank Zhang

Conflicts:

	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
2012-08-22 11:53:59 -07:00