Commit Graph

798 Commits

Author SHA1 Message Date
Alex Huang 1567a112fa unit test works again 2013-01-24 14:36:44 -08:00
Kelven Yang a26e075f0e Remove final modifer to ListS3Cmd class as it conflicts with Spring injection 2013-01-23 18:24:03 -08:00
Kelven Yang 45a92ba369 Fix the initialization of management server 2013-01-23 15:29:41 -08:00
Rohit Yadav 03d2c015ae GenericDao: Add method to find by uuid string including removed entities
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-23 14:57:41 -08:00
Rohit Yadav 7a927e36f0 ReflectUtil: Use collections to grow list and not manual array memory management
Fix usage in ApiDispatcher. Add two kinds of helpers:
- One that gets list of exclude cmd whose fields are not be included
- One that loops till a base class is asssignable from superclass

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-23 14:57:41 -08:00
Rohit Yadav cbdeeebc6c IteratorUtil: Add generic method to return sorted list out of a collection
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-23 14:57:41 -08:00
Alex Huang ee39ec82d3 Making unit tests work 2013-01-22 11:18:51 -08:00
Edison Su 4fbecf15ec add unit test back, primary storage life cycle is tested 2013-01-21 17:01:00 -08:00
Hugo Trippaers 04f82623f6 Merge branch 'master' into cloud-agent-with-openvswitch
Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
2013-01-21 12:18:21 +01:00
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
Rohit Yadav 64f13e1cd8 DatabaseCreator: Fast forward merge due to recent pull in merge of master 2013-01-18 18:16:04 -08:00
Rohit Yadav 7fbe935c36 Transaction: Fix static, add method to reinit static datasource off a db props file
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 18:08:11 -08:00
Rohit Yadav e688fbfc24 ScriptRunner: Alternate constructor to get verbosity flag
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 18:07:37 -08:00
Rohit Yadav 6214b1d4bd db.properties: adding other key value info for dbcreator to work in a generic way
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-18 17:19:55 -08:00
Alex Huang 10d9c019a9 All merge conflicts resolved 2013-01-18 12:14:57 -08:00
Rohit Yadav ddf9c6586d Transaction: cosmetics fix
The default data source assumption is that db server is on localhost, port 3306
and has user cloud and password cloud. The static variables rely on hardcoded
db.properties file only. We need to fix it

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-17 19:09:38 -08:00
Kelven Yang 17a94b20ec Always use premium setting in ConsoleProxyManager 2013-01-17 18:23:06 -08:00
Kelven Yang 93985ae191 allow nested injection in ComponentContext 2013-01-17 18:23:06 -08:00
frank fb050894f5 CloudStack CLOUDSTACK-723
Enhanced baremetal servers support on Cisco UCS

able to dump xmlobject
2013-01-17 16:11:15 -08:00
Rohit Yadav ef07cde449 DBCreator: Fix ScriptRunner to strip comments, reformat code
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-17 16:10:07 -08:00
Kelven Yang 6d155416c2 System VM can start now with Spring bootstraped management server 2013-01-17 14:22:14 -08:00
Alex Huang cbb7ff1c32 added missing files 2013-01-17 06:50:59 -08:00
Alex Huang b751b69c55 Merge branch 'javelin' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack into javelin 2013-01-17 06:50:19 -08:00
Alex Huang 9759ad57f2 Commit the current changes to unit tests 2013-01-17 06:50:11 -08:00
Min Chen 3dabd5fbf3 Clean up ApiServer, ApiServlet and ApiDispatcher flow to handle various CloudRuntimeException
and CloudException in one place, and Introduced ApiErrorCode to handle CloudStack API error
code to standard Http code mapping.

Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-16 22:36:34 -08:00
Min Chen bdcfa1919b Clean up ApiServer, ApiServlet and ApiDispatcher in handling various
exceptions, and Introduced ApiErrorCode to handle CloudStack API error
code to standard Http code mapping.
2013-01-16 21:52:48 -08:00
Kelven Yang 497dcd5044 Get rid of PlugService annotation, replace it with Spring standard injection in command classes 2013-01-16 18:44:44 -08:00
Kelven Yang 2be270de89 Separate loadable components like Gurus, Elements, Adapters to componentContext.xml 2013-01-16 16:33:59 -08:00
frank 53473c07b9 CloudStack CLOUDSTACK-723
Enhanced baremetal servers support on Cisco UCS

introduce an python etree like xml helper.
Ok, this is not a new wheel. Frankly speaking, all Java XML API just suc**.
there are two popular types of XML API in java, one class is for data binding, JAXB,
XStream fall into this category. Another class is tree based, like JDOM, XOM ...

for XML api call, data binding library is painful as you have to specify the schema
that how xml stream converts to java object, which means you have to pre-define all
schemas(xsd file for JAXB, java object for XStream ...). This is not productive, because you
must add new schema when XML document grows.

Tree based library shines in this case, for it's able to dynamically create an object tree
from xml stream without any knowledge of its structure. However, all tree based
XML API library fall into below convention:

Element e = root.getChildElement("child1").getChildElement("child2").getChildElement("child3")...getChildElement("childN")

anything wrong with it???

the sadness is if there is no "child2", you will get a NPE with above code, which means you have to judge
before getting.

And, why so verbose?? why not:

Element e = root.child1.child2.child3...childN ???

Ok I am joking, it's impossible in Java the world knows Java is a static language.

but you can actually do:

Element e = root.get("child1.child2.child3");

or

List<Element> e = root.getAsList("child1.child2.child3")

this is known as XPath style(though XPATH use '/'), python etree has supported it.

so I did this toy for my UCS xml api call, it's quite like etree which is easy to use, for example:

<components.xml>
    <system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
        <checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
        <checker name="EncryptionSecretKeyChecker" class="com.cloud.utils.crypt.EncryptionSecretKeyChecker"/>
        <checker name="DatabaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker"/>
        <checker name="DatabaseUpgradeChecker" class="com.cloud.upgrade.PremiumDatabaseUpgradeChecker"/>
    </system-integrity-checker>
</components.xml>

XmlObject xo = XmlObjectParser.parseFromFile("~/components.xml.in");
List<XmlObject> checkers = xo.getAsList("system-integrity-checker.checker");

then you get a list of XmlObject which represent each 'checker' element:

XmlObject firstChecker = checkers.get(0);
// firstChecker.get("name") == "ManagementServerNode"
// firstChecker.get("class") == "com.cloud.cluster.ManagementServerNode"
// firstChecker.getTag() == "checker"
// firstChecker.getText() == "" if it's <checker/>xxx</checker>, then getText() == "xxx"

example 2:
<checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
    <system-integrity-checker class="com.cloud.upgrade.DatabaseUpgradeChecker">
        <checker name="ManagementServerNode" class="com.cloud.cluster.ManagementServerNode"/>
    </system-integrity-checker>
</components.xml>

yout can do:

XmlObject xo = XmlObjectParser.parseFromFile("~/components.xml.in");
XmlObject checker = xo.get("system-integrity-checker.checker");

then it returns a single object as we only have one "checker" in xml stream,

or you still do

List<XmlObject> checkers = xo.getAsList("system-integrity-checker.checker");

it returns a list which only contains one element of "checker"

if you do:

XmlObject checker = xo.get("system-integrity-checker.checker.this_middle_element_doesnt_exist.some_element");

it returns a null without any exception, so you don't have to worry if a parent element is missing when getting a leaf element

again it's not a new wheel, I just hate JAVA xml api
2013-01-16 16:27:21 -08:00
Kelven Yang 727fab71cb Disable StorageProvider, storageType introduced in Javelin new code, temporarily, to make existing code run 2013-01-16 14:16:01 -08:00
Kelven Yang 4c1257bf18 Handle proxy object situation in dispatching API command 2013-01-16 11:28:09 -08:00
Min Chen 97cb16944f Merge branch 'master' into api_limit 2013-01-15 18:18:34 -08:00
Min Chen 8608925216 Consolidate RuntimeCloudException and CloudRuntimeException into one
class CloudRuntimeException, and removed RuntimeCloudException to avoid
confusion.
2013-01-15 18:07:08 -08:00
Min Chen 4355d06a86 Reuse APIChecker adapter interface for APi Rate limit checking and optimize ApiRateLimitService interface.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-15 15:53:19 -08:00
Kelven Yang af67d87662 Fix issues with @DB support in Spring environment 2013-01-15 12:35:03 -08:00
Hugo Trippaers 2d69a1855d Summary: Begone pesky tabs 2013-01-15 10:00:58 +01:00
Hugo Trippaers a0ade283b7 Summary: Add initial support for OpenVswitch to the KVM hypervisor
Create OvsVifDriver to deal with openvswitch specifics for plugging
intefaces

Create a parameter to set the bridge type to use in
LibvirtComputingResource. 
Create several functions to get bridge information from openvswitch

Add a check to detect the libvirt version and throw an exception when
the version is to low ( < 0.9.11 )

Fix classpath loading in Script.findScript to deal with missing path
separators at the end.

Add notification to the BridgeVifDriver that lswitch broadcast type is
not supported.
2013-01-15 09:09:14 +01:00
Rohit Yadav 0a31945ee5 PluggableService: Fix interface to return list of cmd classes
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-14 19:01:26 -08:00
Rohit Yadav ea3f5ecb54 Fix license for xml files in javelin
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:31:47 -08:00
Rohit Yadav 38eaa04b98 Pull changes from master into javelin
- Disables simulator plugin, breaks build, available via simulator profile
- Fixes spring injections
- Fix api,acl plugins, ApiServer, ApiDispatcher
- Fix other merge conflicts

Conflicts:
	docs/en-US/external-firewalls-and-load-balancers.xml
	plugins/acl/static-role-based/src/org/apache/cloudstack/acl/StaticRoleBasedAPIAccessChecker.java
	server/src/com/cloud/api/ApiDispatcher.java
	server/src/com/cloud/api/ApiServer.java
	server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
	utils/test/com/cloud/utils/log/CglibThrowableRendererTest.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-12 06:02:54 -08:00
Rohit Yadav 7960dd429b utils: Fix getByUuid to accept string arg, it's not gonna be anything else
Due to generic programming, most classes declare Daos with ID as Long, so they
get the getUuid(Long) definition, it has to be getUuid(String), uuid is not
gonna be anything else. Fix GenericDaoBase and GenericDao.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-11 18:44:19 -08:00
Kelven Yang f57dcaa820 Loadable components to be in separted Spring component bundling 2013-01-11 15:33:15 -08:00
Noa Resare 1033200b0b CLOUDSTACK-933: CglibThrowableRendererTest writing stack traces...
Improve CglibThrowableRenderer test case

Log to a separate Logger instead of the default one to avoid spurious
stack traces in test run output.

Actually verify that registering CglibThrowableRenderer with the
alternative log hierarchy actually removes call trace lines that
contains the string <generated>
2013-01-11 17:09:44 -05:00
Alex Huang 757e1a931b cleanup warnings in utils 2013-01-10 17:19:30 -08:00
Alex Huang 1294cdc701 pulled from master 2013-01-10 16:01:01 -08:00
Alex Huang d6f44a4d6a merged from master 2013-01-10 15:55:42 -08:00
Rohit Yadav c4e890c55d PluggableService: Refactor method to return map of key value pairs
- Makes plugins self contained so they decide their properties file format
- PluggableService creates the contract that implementing entity will return a
  properties map which is apiname:rolemask (both are strings)

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:02 -08:00
Rohit Yadav f2ae0ae5ae PropertiesUtil: Refactor process config file method in utils, return map of key=value
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-10 15:55:01 -08:00
Alex Huang f922c6fc03 Keep removing 2013-01-10 14:46:52 -08:00
Alex Huang 56e5fbdee2 removed import of componentlocator and inject from all files 2013-01-10 11:44:47 -08:00
Alex Huang 395de6f2b3 merge from latest pull 2013-01-10 11:07:11 -08:00
Alex Huang f40e7b7511 removed componentlocator and inject 2013-01-10 11:05:20 -08:00
Min Chen 7f8262d45e Remove IdentityProxy and IdentityTypeAdapter class.
Signed-off-by: Min Chen <min.chen@citrix.com>
2013-01-09 17:40:58 -08:00
Kelven Yang cf5d935d81 Seperate configurable components out and let them be loaded from Spring configuration file 2013-01-09 14:39:16 -08:00
Alex Huang b6c56736e5 merge from master 2013-01-09 05:20:36 -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
Rohit Yadav db297a338f utils: Reflection utilities to get cmd, annotation and fields
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-08 18:54:29 -08:00
Kelven Yang b274c570f9 Cleanup places that use explicit wiring of the components 2013-01-08 17:45:33 -08:00
Alex Huang 7f3a748d6c Merge branch 'javelin' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack into javelin 2013-01-08 14:46:38 -08:00
Kelven Yang 32e67f60d4 Work with Spring proxy-ed object 2013-01-08 14:24:19 -08:00
Alex Huang cf8de7ee17 Removed all the .project files 2013-01-08 14:11:00 -08:00
Alex Huang 30f2565d98 Merge branch 'api_refactoring' into javelin 2013-01-08 12:36:04 -08:00
Kelven Yang 992fa473be convert existing singleton objects into Spring loadable bean components 2013-01-08 11:07:22 -08:00
Rohit Yadav 0a25884215 Merge branch 'master' into api_refactoring 2013-01-07 17:28:57 -08:00
Kelven Yang 559933f062 First page of Javelin management server bootstraped by Spring is able to show now 2013-01-07 15:54:18 -08:00
Hugo Trippaers d616dcdd40 Summary: small fix for the classpath loader
Add the file separator if the path does not end with one
2013-01-07 22:17:55 +01:00
Rohit Yadav 0659c21f2d Get latest changes, Merge branch 'master' into api_refactoring 2013-01-04 17:22:57 -08:00
Noa Resare 0055d80211 CLOUDSTACK-771: maven: add mysql version reference to enable non-snapshot builds
If you update your build to build a version with a name not ending in -SNAPSHOT,
you are required to declare versions on all your depdendencies. There is already
a cs.mysql.version property, this patch makes sure it is used where appropriate.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2013-01-04 12:20:06 -05:00
Kelven Yang 25d14418b9 Replace Adapters<T> with standard List<T> to work with Spring injection 2013-01-03 13:33:52 -08:00
Rohit Yadav d235859168 Fix PluggableService to provide interface for ACL adapters etc. to get configs
- Fix interface to return array of strings, or filenames
- Fix StaticRoleBased ACL adapter to process config files by going through all pluggable services
- Refactor interface names

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 16:29:39 -08:00
Rohit Yadav d8d87adc22 Merge branch 'master' into api_refactoring
Conflicts:
	api/src/com/cloud/api/commands/ListS3sCmd.java
	server/src/com/cloud/configuration/ConfigurationManagerImpl.java
	setup/db/db/schema-40to410.sql

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2013-01-02 13:57:55 -08:00
John Burwell e4583ced2e S3-backed Secondary Storage 2013-01-02 10:28:47 -08:00
Rohit Yadav 78d70d349b Merge branch 'master' into api_refactoring
- Applies Isaac Chian'gs fix (CLOUDSTACK-648) to allow user change their password
- TODO: Fix response, only partially applied

Conflicts:
	api/src/org/apache/cloudstack/api/response/UserResponse.java
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/api/ApiResponseHelper.java

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-25 09:51:17 -08:00
Prasanna Santhanam 1f1a13448f simulator: resurrect simulator hypervisor as plugin
Multiple fixes:
1. changes to the mvn configuration
    a. include simulator to client.war
    b. activate simulator by profile
2. templates for simulator
3. developer prefill for simulator
    a. Use deplydb-simulator to setup simulator db
4. Inherit components-simulator.xml from components.xml
5. ListVolumesCommand missed for MockStorageManager
6. Include simulator properties into utils/db.properties

TODO:
 Secondary storage VMs don't come up because ComponentLocator doesn't
retain a unique set of adapaters by name. Fix this in subsequent
checkin.
2012-12-23 19:28:57 -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
Min Chen a88ce6bb7f Remove IdentityProxy from CloudException and ExceptionResponse. 2012-12-19 23:49:44 -08:00
Rohit Yadav ba5fba939c api: Fix method name findByXId to findByUuid
- findByXId is read as find using some external Id (used by external network devices for ex.)
- what we really need is findByUuid that finds a unique VO using a uuid string

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 17:44:17 -08:00
Rohit Yadav 837d21bb2d api: Implement findByXId in GenericDaoBase and EntityManagerImpl
Declare and define findByXId() in GenericDao and EntityManager.
This method would return a VO by UUID and EntityManager's interface would
take in the VO Interface.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-18 04:10:36 -08:00
Rohit Yadav 5572707ec6 maven: Bump httpcore version, add guava and httpclient dependency
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
2012-12-17 20:44:48 -08:00
Chip Childers bec00cce46 CLOUDSTACK-505: Converted regex expressions to pre-compiled Pattern objects
This was done for performance reasons.

I also refined the regex strings and added more test cases for different
string scenarios.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-17 23:01:19 -05:00
Chip Childers 44da7b1841 CLOUDSTACK-505: Reworked approach to cleaning request / response strings
As noted in the bug, several of the API command in question
are async calls.  I've added a simple regex-based string cleaning
function, and have the request and response strings running through
it prior to being appended to the audit log.

Unit tests added for the new cleaning function as well.

The call to skip logging the createSSHKeyPair response remains intact
for now, although it should probably be scrubbed similarly to the
password fields.

Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-12-17 14:11:09 -05:00
Edison Su b70c1a5a84 Backs NFS-based secondary storage with an S3-compatible object store. Periodically, a reaper thread synchronizes templates and ISOs stored on a NFS secondary storage mount with a configured S3 object store. It also pushes snapshots to the object store when they are created and downloads them in other zones on-demand. In addition to permitting the use of commodity or IaaS storage solutions for static assets, it provides a means of automatically synchronizing template and ISO assets across multiple zones. 2012-12-13 23:18:37 -08:00
Laszlo Hornyak 988ccfc45d removed some unused database connection properties
Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
2012-12-13 22:46:29 -08:00
Likitha Shetty 2a8b9e5130 CLOUDSTACK-292: AWSAPI calls fail with 'com.cloud.utils.exception.CloudRuntimeException: DB Exception on: null' 2012-12-13 22:06:16 -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 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
Rohit Yadav 5edfc2760a refactor: remove redundant imports, fix trailing chars 2012-12-03 13:54:37 -08:00
adefanti 2a0d0104bd maven : declare mysql-connector-java dependency into dependencyManagement section of cloudstack pom and use the version 5.1.21 only
Signed-off-by: Hugo Trippaers <trippie@gmail.com>
2012-11-20 09:27:07 +01:00
Vijay Venkatachalam 527b5c8ee2 Autoscale: Supporting network element independent counter parameters Reviewed-By:Devdeep 2012-11-16 10:57:00 +05:30
Vijay dda4d39b55 AutoScale changes in Apache master 2012-11-16 10:56:44 +05:30
Kelven Yang 2cae511464 Connnect event bus to messaging layer 2012-11-14 19:28:59 -08:00
Laszlo Hornyak 1a67e3f5c6 Summary: Extract redundant datasource code into method for Transaction.java
Reviewed-by: Prasanna Santhanam <tsp@apache.org>
Reported-by: Laszlo Hornyak <lhornyak@redhat.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org> 1352745925 +0530
2012-11-13 00:15:24 +05:30
Kelven Yang 8eadeba37c Fix the compiling issue for usage server caused by mering the Spring work 2012-11-07 15:20:01 -08:00
Kelven Yang d79f1f6fdc Replace Adapters and PluggableServices, use Spring to load them 2012-11-07 15:03:24 -08:00
Kelven Yang 453b31f3f4 Refactor ComponentLocator to be based on Spring so that legacy way of loading component can coexist with Spring 2012-11-07 15:03:23 -08:00
Kelven Yang 0e9924fcee Add autowiring+AOP support to injected components 2012-11-07 15:03:23 -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
Alex Huang 91e68b5f2c A bunch of .project changes again 2012-11-04 19:25:03 -08:00
Alex Huang 7397716fcd added missing files 2012-11-01 13:57:34 -07:00
Hugo Trippaers f65b268a2e Active the testrun by default in maven
Exclude the tests that need a database, these should move to the
integration test phase or use an in memory database maybe.
2012-10-30 14:15:07 +01:00
Edison Su f36b2f9970 add more files 2012-10-29 17:46:15 -07:00
Kelven Yang d70154609a Wire up injection for dynamically constructed objects 2012-10-29 16:16:07 -07:00
Edison Su 0debd8a393 add more classes 2012-10-29 09:32:28 -07:00
Hugo Trippaers 6a9c588d33 Fix loading of external script so they will be loaded from the webapp classloader.
This change will allow the Script class to look for resources in the classpath of the webapp. This makes it possible to distribute the management server as a single prepackaged war. An added benefit is easier integration with IDE's that have the option to start webapps internally.

Also fixes a bug/feature in the URL handling were some components of the script path were translated to urlencoding. This  change means that files are more often found in the first two steps of the findScript method which saves some filesystem calls.
2012-10-26 15:32:00 +02:00
Kelven Yang 16ed8701da Test of using Spring DI to implement Basic/Premium configuration 2012-10-25 18:22:32 -07:00
Kelven Yang c272cf6b69 add TransactionContextBuilder based on Spring AOP 2012-10-25 15:01:12 -07:00
Alex Huang 525f96b7ae fixed tab problems 2012-10-25 13:13:47 -07:00
Min Chen 7b7f4cd1fd CLOUDSTACK-409: ThreadLocal Transaction and its db connection got reset for user managed db connnection, causing ClusterHeartBeat thread frequently trying to get db connection. Add unit test to test user managed transaction. 2012-10-25 13:06:50 -07:00
Edison Su 6a7215cedc fix default templateadaptor is not injected 2012-10-24 16:00:57 -07:00
Alex Huang f92ce72639 Correct dependency errors 2012-10-24 11:12:40 -07:00
Edison Su 059f605ace add more interfaces 2012-10-22 17:50:51 -07:00
Hugo Trippaers 5b2e1f42b7 The adapterlist needs to be merged instead of overwritten in
ComponentLocator.

When using the extend option in the components-nonoss.xml the adapter
lsit was overwritten (putAll on the map), but it should be merged
instead. This prevented adapters from the parent to be loaded.
2012-10-22 11:13:34 +02:00
Kelven Yang 8e59b3acfb Architecture refactoring - Stateless management server - Spring Framework initiatives, add missing files 2012-10-19 15:32:24 -07:00
Kelven Yang 8ef9e32cfd Architecture refactoring - Stateless management server - Spring Framework initiatives 2012-10-19 15:24:15 -07:00
Kishan Kavala f0f33bf4da Added Mock ApiServer, Regions API calls with api keys 2012-10-17 14:16:36 +05:30
Kelven Yang 24530a274e Architecture refactoring - Stateless management server - EventBus 2012-10-15 18:10:38 -07: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
Kelven Yang 5d7509e964 Merge DB query builders from master 2012-10-11 18:24:33 -07:00
Kelven Yang 5fee891162 merge from master 2012-10-11 17:42:25 -07:00
Edison Su 06d516a80c if db.properties.override missing, shouldn't panic 2012-10-10 16:20:35 -07:00
Hugo Trippaers f16b5103d8 Merge some stuff from maven-waf branch into master 2012-10-01 15:04:08 -07:00
Hugo Trippaers aa6355ffe6 Updated master to 4.1.0
mvn release:update-versions -DautoVersionSubmodules=true -Dnonoss -P
client,deps,developer  -DdevelopmentVersion=4.1.0-SNAPSHOT
2012-10-01 11:00:55 -07:00
Chip Childers b10031ba97 CLOUDSTACK-135 - Removed extra LICENSE file. 2012-09-19 11:51:16 -04:00
Alex Huang 387c6fc135 Merge branch 'master' into javelin 2012-09-17 15:31:37 -07:00
Edison Su e903f83872 fix simulator compilation 2012-09-14 13:38:08 -07:00
Alex Huang db9cc97ab3 Brought over new changes from master 2012-09-13 11:43:22 -07:00
Manikanta Kattamuri cfc2b85651 Removing eclipse .classpath and .project files as they are configured to ant build and adding the entries into .gitignore to stop further comitting of the files
Signed-off-by: Chip Childers <chip.childers@gmail.com>
2012-09-13 14:18:14 -04:00
Mice Xia 55bcfaf805 CLOUDSTACK-88 Cannot listVM by vpcId which is required by VPC UI 2012-09-13 11:21:11 +08:00
Mice Xia c86711a5a9 CLOUDSTACK-69 Hibernate jars should be removed 2012-09-11 17:37:10 -07:00
Mice Xia 0d02e33d31 CLOUDSTACK-69 Hibernate jars should be removed 2012-09-10 21:15:35 +08:00
Alex Huang 1d0a10c69e Merged master over to javelin to get new poms and maven build 2012-09-05 14:31:24 -07:00
Alex Huang e41cb9ff74 More changes 2012-09-05 13:39:32 -07:00
Rajesh Battala 39aa7d86af Moved Awsapi (EC2/S3) from Hibernate framework to CloudStack Generic Dao Framework
Created/Modified new VO's and Dao Impl classes to use Generic Dao Framework
2012-08-31 11:44:58 -07:00
Alex Huang 28982486e7 New String Util 2012-08-30 18:56:35 -07:00
Alex Huang b9ddcf8cfe Started an object model for the orchestration platform 2012-08-30 15:54:33 -07:00
Alex Huang 6309253de1 Deleted some useless files 2012-08-30 09:59:25 -07:00
Hugo Trippaers a6be8c76c3 Reverting part of commit ff7c964a66 (Add
ability to do jetty:run in eclipse). This change breaks the ability to
upload scripts to XenServer (and possibly other places). Needs some
investigation before enabling this again.
2012-08-30 16:10:28 +02:00
Kelven Yang 2300310243 Messaging facility initials for new architecture 2012-08-28 17:58:45 -07:00
Darren Shepherd ff7c964a66 Add ability to do jetty:run in eclipse 2012-08-28 09:16:44 -07:00
Darren Shepherd 43e4de429e Fix up some dependencies 2012-08-28 09:03:25 -07:00
Darren Shepherd 590f52df82 Include some missing resources in the jars 2012-08-28 08:59:20 -07:00
olivier lamy 40f9d84ea9 versions defined in parent pom 2012-08-27 21:54:27 +02:00
olivier lamy a06ed5728c remove intermediate parent poms 2012-08-27 16:43:24 +02:00
olivier lamy 3aa469da2a groupdId is now org.apache.cloudstack 2012-08-25 09:20:21 +02:00
olivier lamy 5ef60aceb1 %s/tab/ws/ 2012-08-25 00:03:23 +02:00
Darren Shepherd 4a4007e652 Add license 2012-08-24 11:18:54 -07:00
Darren Shepherd ebc0fa458a * Maven 3 support
* Pretty Format POM's
* AWS API compiles now
2012-08-24 11:18:54 -07:00
Darren Shepherd f826971fea Maven config, initial commit 2012-08-24 11:18:52 -07:00
Kelven Yang d06d6dae72 add maven eclipse project files from Darren 2012-08-23 17:55:20 -07:00
Kelven Yang 9a51ff3bfc Maven worksplace fixes/patches from Darren 2012-08-23 14:26:27 -07:00
Darren Shepherd 2f6cc4b0cb Add license 2012-08-23 14:26:26 -07:00
Darren Shepherd ad54ed1790 * Maven 3 support
* Pretty Format POM's
* AWS API compiles now
2012-08-23 14:26:26 -07:00
Darren Shepherd b8e95e435f Maven config, initial commit 2012-08-23 14:26:25 -07:00
Chiradeep Vittal 5b85edb961 bug CS-16034 getRandomIp can return -1 unexpectedly
also fixes unit test failures
2012-08-16 11:42:25 -07:00
Mice Xia 00b2a8040b Remove @author tag from non third-party source files in agent-simulator, cloud-cli, test, ui and utils folder 2012-08-13 15:30:42 +08:00
Sheng Yang a4431b5740 S2S VPN: Use coma instead of semicolon for separating cidr list 2012-08-10 16:20:52 -07:00
Alena Prokharchyk ccac505944 Merge branch 'master' into vpc 2012-08-10 10:47:49 -07:00
Chip Childers 0ad8118562 Fixed three .classpath license header issues 2012-08-09 14:21:06 -04:00
Alena Prokharchyk c5e3493792 Merge branch 'master' into vpc 2012-08-08 18:38:35 -07:00
Alex Huang e83c60a057 added JoinType to remove the j2ee source code in CloudStack 2012-08-08 13:42:08 -07:00
Alex Huang f04c006f9a Added javax.persistence and javax.ejb jar packages to replace the files removed. Added a new annotation to replace the encrypt attributed added to the Column annotation. Removed join attribute added to SecondaryTable in previous commit 2012-08-08 12:58:24 -07:00
Alex Huang 457f3b3dc9 Removed all javax source code from utils package 2012-08-08 12:58:22 -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
Alex Huang 57b57703eb fixed broken unit test 2012-08-07 17:38:05 -07:00
Alex Huang a617ccc898 Added missing file 2012-08-07 15:52:34 -07:00
Alex Huang a6a864a1a8 Removed Base64 file and use the apache version 2012-08-07 15:41:54 -07:00
Alex Huang 1d3a443237 Added support for component libraries in plugins 2012-08-07 15:40:01 -07:00
Alena Prokharchyk d38e9eebed VPC: CS-15850 - don't unplug the nic for public network when there are existing ips in the same vlan having network rules
Conflicts:

	server/src/com/cloud/network/vpc/VpcManagerImpl.java
2012-08-07 11:25:02 -07:00
Alena Prokharchyk cf64fda5d5 VPC: unittest preparation
Conflicts:

	server/src/com/cloud/network/vpc/VpcManagerImpl.java
	server/test/com/cloud/network/MockNetworkManagerImpl.java
2012-08-07 11:23:52 -07:00
Sheng Yang 84a1a311f9 S2S VPN: CS-15511: Add PFS support for VPN connection 2012-08-06 15:27:13 -07:00
Alena Prokharchyk 5a72044dc7 Merge branch 'master' into vpc 2012-08-03 14:30:54 -07:00
Chip Childers 95ce55f0a1 License header updates for the utils folder 2012-08-03 14:15:09 -04:00
Alena Prokharchyk 0588c9748c VPC: CS-15818 - don't allow having ICMP networkACLs with the same cidr and icmpType=-1 for rule1 and icmpType!=-1 for rule 2 as the rule1 covers rule2 in this case
Conflicts:

	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
	utils/src/com/cloud/utils/net/NetUtils.java
2012-08-02 18:09:10 -07:00
Alena Prokharchyk 8f797afd42 VPC: CS-15813 - ICMP type and code validation
Conflicts:

	server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
	utils/src/com/cloud/utils/net/NetUtils.java
2012-08-01 19:55:51 -07:00
Sheng Yang e8d2ca48b4 S2S VPN: Update the supported crypto list
We would support 3DES, AES128, AES192, AES256.
2012-07-30 16:43:55 -07:00
Sheng Yang e9ae7336c1 CS-15649: Remove DES from s2s vpn support policy
DES is considered INSECURE.
2012-07-20 10:53:42 -07:00
Sheng Yang c0fcca3990 CS-15511: Not allow pfs parameter for customer VPN gateway 2012-07-19 15:10:31 -07:00
Alena Prokharchyk 4a7149e6b5 VPC: CS-15580 - don't allow gateway for VPC guest network to be equal to the cidr subnet
Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/vpc/VpcManagerImpl.java
2012-07-13 17:09:16 -07:00
Sheng Yang 94c62f2127 CS-15513: Fix group 5 of s2s vpn
Conflicts:

	utils/test/com/cloud/utils/net/NetUtilsTest.java
2012-07-10 10:38:17 -07:00
Alena Prokharchyk 353423acec Merge branch 'master' into vpc
Conflicts:
	api/src/com/cloud/api/commands/ListFirewallRulesCmd.java
	api/src/com/cloud/api/response/FirewallResponse.java
	api/src/com/cloud/api/response/IPAddressResponse.java
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
	server/src/com/cloud/network/dao/NetworkDaoImpl.java
	server/src/com/cloud/server/ManagementServerImpl.java
2012-07-06 12:04:10 -07:00
David Nalley 53d5fe6636 fixing another license header 2012-07-04 19:47:12 -04:00
Sheng Yang 24c480f9e6 CS-6840: Add commands for site-to-site vpn
Conflicts:

	api/src/com/cloud/api/BaseCmd.java
	api/src/com/cloud/api/ResponseGenerator.java
	client/tomcatconf/commands.properties.in
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	utils/test/com/cloud/utils/net/NetUtilsTest.java
2012-07-02 16:26:34 -07:00
Alena Prokharchyk 1f01d923ca Merge branch 'master' into vpc 2012-06-28 17:44:08 -07:00
Alena Prokharchyk 634cd78baa Merge branch 'master' into vpc
Conflicts:
	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/ListNetworksCmd.java
	api/src/com/cloud/api/response/NetworkResponse.java
	api/src/com/cloud/event/EventTypes.java
	api/src/com/cloud/network/NetworkService.java
	client/tomcatconf/commands.properties.in
	scripts/network/domr/getDomRVersion.sh
	scripts/network/domr/ipassoc.sh
	scripts/network/domr/l2tp_vpn.sh
	scripts/network/domr/networkUsage.sh
	scripts/network/domr/router_proxy.sh
	server/src/com/cloud/api/ApiDBUtils.java
	server/src/com/cloud/api/ApiResponseHelper.java
	server/src/com/cloud/configuration/DefaultComponentLibrary.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/dao/IPAddressDao.java
	server/src/com/cloud/network/dao/IPAddressDaoImpl.java
	setup/apidoc/gen_toc.py
	setup/db/create-schema.sql
	wscript
2012-06-28 17:41:40 -07:00
Alena Prokharchyk 46b97cbf7d VPC: update public IP info in domain_router table once the VR gets the public nic 2012-06-28 10:25:24 -07:00
Murali reddy 8197f1f07c moving out VMWAre and Nexus VSM support code into plugins/hypervisors/vmware 2012-06-26 19:48:55 -07:00
Alena Prokharchyk 55a12582b4 Completed API / Management server code for Resource tags feature. UI is yet to be done 2012-06-20 15:45:08 -07:00
Vijayendra Bhamidipati fe76cf8a60 CS-15241: static NAT is not working when provider is set to Juniper SRX
Description:

	Checking in fix for the exception seen due to the absence of
	the AsyncCommandQueued exception in the map of CSExceptionErrorCode
	which is used to look up the error code corresponding to a
	cloudstack exception. Also printing the stack trace in case
	an exception is not found in the map.
2012-06-19 11:44:48 -07:00
Vijayendra Bhamidipati e177b8d6f6 CS-15241: static NAT is not working when provider is set to Juniper SRX
Description:

	Checking in fix for the exception seen due to the absence of
	the AsyncCommandQueued exception in the map of CSExceptionErrorCode
	which is used to look up the error code corresponding to a
	cloudstack exception. Also printing the stack trace in case
	an exception is not found in the map.

Conflicts:

	utils/src/com/cloud/utils/exception/CSExceptionErrorCode.java
2012-06-15 14:29:12 -07:00
David Nalley b7ca7f8df2 Doh, broke the build - fixing that. 2012-06-06 23:21:54 -04:00
David Nalley 937a9f7c45 fixing utils license header 2012-06-06 23:06:02 -04:00
Devdeep Singh 0e3bf8cabb CS-14956: Fixing an issue that surfaced while testing rate limiting
policies. An error was getting reported during policy map creation that
config operation was in progress, Added synchronization to make sure
sending and receiving commands are seralized. Also removed the retry logic
as after this change it is not needed.

Reviewed-By: Vijay
2012-05-25 19:35:34 -07:00
Vijayendra Bhamidipati ec83e0e939 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Removing the CiscoNexusVSMService class since
	we don't use it anywhere.
2012-05-25 18:38:42 -07:00
Devdeep Singh 5fc5b7a0eb CS-9919: Adding helper routines to query details of a port profile and
associated policy maps. Also updating the error message logs.
2012-05-25 18:24:20 -07:00
Devdeep Singh 3006bed6df CS-14948: Fixing an issue with parsing the xml-rpc response to a command
from vsm. This was throwing false exceptions when infact the command
execution was a success. Also adding retry logic for create port profile
request.
2012-05-25 18:08:48 -07:00
Sateesh Chodapuneedi 6d896951b3 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Increasing the window for xmlstream.
2012-05-25 17:41:31 -07:00
Devdeep Singh 8db1ca296b CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Do not set the access mode of an interface if vlanid is zero.
2012-05-25 17:41:17 -07:00
Devdeep Singh 8d1b9c2477 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding api to remove from a service policy
	(policy map) from a port profile.
2012-05-25 17:36:48 -07:00
Devdeep Singh ec19facd30 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding apis to create service policies and
	associate them with a port profile.
2012-05-25 17:36:42 -07:00
Devdeep Singh 0e293b7b5b CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Made changes to persist the vsm configuration
	after updating it.
2012-05-25 17:18:11 -07:00
Devdeep Singh 76e1d338f3 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding a helper routine for modifying port
	profile configuration.
2012-05-25 17:18:04 -07:00
Devdeep Singh 4ff2893ffc CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Updated the add port profile routine to support
	more options (bindingtype, switchport mode, port
	profile types).
2012-05-25 17:17:43 -07:00
Devdeep Singh 441a811927 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Added handling for error responses from vsm.
	Fixing an issue with port profile creation.
2012-05-25 17:17:02 -07:00
Devdeep Singh 3fd32c1784 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Removing unused classes and references to them.
2012-05-25 17:16:55 -07:00
Devdeep Singh 631cc863e1 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Updated the rpc request generation logic for
	creating and deleting port profiles.
2012-05-25 17:16:48 -07:00
Vijayendra Bhamidipati 5109902c9f CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Update create-schema.sql to create tables for
	VSM and VSM-Cluster mapping.

	Fixed an incorrect exception path in
	CSExceptionErrorCode.

Conflicts:

	utils/src/com/cloud/utils/exception/CSExceptionErrorCode.java
2012-05-25 17:11:49 -07:00
Devdeep Singh 1198a62453 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding a netconf helper class for adding and
	deleting port profiles. These functions need
	to be further parameterized and error handling
	needs to be taken care of.
2012-05-25 17:09:54 -07:00
Vijayendra Bhamidipati b0facd16e4 Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
At this point, the mgmt server comes up, loading the
	   Nexus related modules without dying.

Description:

	1) Added a new properties file for Cisco N1kv VSM commands:
		cisconexusvsm_commands.properties.in

	2) Added the CiscoNexusVSMElement to the components.xml file.

	3) Modified CiscoNexusVSMElement to implement NetworkElement.

		The NetworkElement interface functions are not
	  	relevant to the N1KV VSM, so we override them
	  	with noops.

	4) Added an addDao() of CiscoNexusVSMDeviceDaoImpl in populateDaos(),
	   else we'd run into a failure to look up the VSM's dao when the
	   mgmt server is starting up:

		com.cloud.utils.exception.CloudRuntimeException: Unable to find DAO com.cloud.network.dao.CiscoNexusVSMDeviceDao

	5) Also added the CiscoNexusVSMElementService in populateServices(),
	   and modified CiscoNexusVSMElement to implement Manager as well.

	6) populateServices() was running into an exception that indicated
	   that it was unable to find a commands.properties file for the
	   cisco n1kv vsm service. Fixed it by changing getProperties() in
	   CiscoNexusVSMElement to return the correct string
	   "cisconexusvsm_commands.properties", and putting in an @Override
	   for getProperties() in CiscoNexusVSMElement. Also fixed up all
	   the other functions in CiscoNexusVSMElement that needed to have
	   @Override. Also updated build/developers.xml with this file
	   location. And did other small cleanup.

	7) More clean up in CiscoNexusVSMDeviceManagerImpl.

Conflicts:

	server/src/com/cloud/configuration/DefaultComponentLibrary.java
2012-05-25 17:07:03 -07:00
Vijayendra Bhamidipati 32ba2ef17a CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Reviewed by: Sateesh Chodapuneedi, Devdeep Singh

Description:

This is the first in a series of commits for integrating the
Cloudstack Management Server with the Nexus 1000v Virtual
Supervisor Module.

These changes introduce the necessary API command interfaces
to work with a Cisco N1KV VSM. The backend logic is still to
be put in and will be incorporated in subsequent commits.
Please do not attempt to use these APIs until then. Also,
these are not yet filled in into commands.xml, so they are
not currently exposed.

Additional APIs would be added if required.

These changes will not break any current management server
functionality.

Given below is a description of the changes put in here:

	Added Cisco N1KV commands to core/api:
	    These are the added commands -

		AddCiscoNexusVSMCmd
		DeleteCiscoNexusVSMCmd
		ConfigureCiscoNexusVSMCmd
		ListCiscoNexusVSMCmd
		ListCiscoNexusVSMNetworksCmd

	Added a Network Element service file for Cisco N1KV.

	Declared the interface functions that we'll need for
	the N1KV VSM.

	Defined a DeviceVO file for the Cisco Nexus Element.

	Created a response file for Cisco Nexus VSM.

	Created new event types for external Switching Management devices.

	Put in logic to call interface methods in ListCiscoNexusVSMNetworksCmd
	and ListCiscoNexusVSMCmd

NOT VSM RELATED:
	Fixed minor typo in some of the event types for external load balancers.

       Added properties of a VSM in the VSM VO class.

       Replaced the "url" input parameter by "ipaddress"
       in the AddCiscoNexusVSMCmd API.

       Added a new file - CiscoNexusVSMElement.java to
       contain the implementation of the functions
       declared in the VSMElementService interface, and
       put in implementations of the functions for the
       Nexus VSM API commands. These functions are
       defined in the CiscoNexusVSMElement class.

       Added a class for Port Profiles (PortProfile.java).
       The fields in this class are still not correctly
       declared as of now. We'll make the required changes
       going forward.

	Added CiscoNexusVSMDeviceManagerImpl class.

	Added CiscoNexusVSMResource class.

	Created a new class to provide a package to
	connect to Cisco Nexus VSMs. This will be a
	set of Java wrapper functions that allow us
	to connect/disconnect and send commands and
	receive the results of those commands via
	XML-RPC. These functions are yet to be
	implemented, and will be checked in in future
	commits.

	Added two new classes, VSMCommand and
	VSMResponse, to encapsulate XML-RPCcommands
	and responses to and from a Ciscon Nexus VSM.

	Put in the following function stubs inside the
	CiscoNexusVSMService class:

		connectToVSM()
		disconnectFromVSM()
		executeVSMCommand()

	Added new field in the Type enum of the "Host"
	interface, for Cisco Nexus VSMs.

	Added two parameters to AddCiscoNexusVSMCommand
		vsmName
		zoneId

	Modified the CiscoNexusVSMDeviceVO constructor to
	take in an zoneId as a parameter when creating
	the VO object.

	Added new interface and class for the DeviceDao
	implementation for Cisco Nexus VSM devices:
		CiscoNexusVSMDeviceDao
		CiscoNexusVSMDeviceDaoImpl

	Removed the vsmvCenterDomainId property, since it's
	going to the same as vsmDomainId, which is the VSM's
	switch Domain Id.

	Have started putting in the following query functions
	in the CiscoNexusVSMDeviceDao interface:

	Put in DAO implementations of some of the above functions in the CiscoNexusVSMDeviceDaoImpl class.

	Added a vsmName parameter to the CiscoNexusVSMDeviceVO class.
2012-05-25 17:05:15 -07:00
frank bd47cd104c CloudStack CS-14475
Atomatic addition of Apache license header broke lots of mysql files

fix DB upgrade cleanup script not get executed issue.

add "#" as comment signature in ScriptRunner.java
2012-04-13 15:34:59 -07:00
Alex Huang 7c6932ef80 some reformatting and a new way to get vos into the system 2012-04-12 11:04:38 -07:00
David Nalley 91fadc4a0d fixing line ends in utils 2012-04-09 20:05:41 -04:00
frank 2f634c0913 Switch to Apache license 2012-04-03 04:50:05 -07:00
Vijayendra Bhamidipati 005ba5e2b5 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Adding overloaded addProxyObject() function to CloudException
	and RuntimeCloudException classes and using this function
	to stuff exceptions with IDs, to reduce code footprint.
2012-03-15 16:27:52 -07:00
Vijayendra Bhamidipati 6ac79c4be2 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Adding a new class AnnotationHelper, that provides routines
	to read annotations from a VO class.

	Cloudstack does the mapping between cloudstack java VO objects
	and the database tables using cglib. cglib creates proxy objects
	as the maps between VO objects and the database.  A VO (value
	object) class is populated after querying from the MYSQL database.

	Ideally, a getAnnotation() issued on a cglib proxy object should
	get a list of all the annotations in all classes in the inheritence
	chain. However, this functionality seems to be currently broken
	in cglib.  Hence, when querying for annotations given the object
	of a VO class, we need to get to the corresponding VO class of that
	cglib proxy class and issue a getAnnotation() on that class. To get
	the VO class, we simply need to get the super class of the proxy
	object. Also, we need to recurse to the root VO class in case the
	VO class extends another VO class.

	Note that the cache used by CS is ehcache.
2012-03-08 17:34:28 -08:00
Vijayendra Bhamidipati 96f8111558 Bug 14060: Include a CloudStack error code in an Exception Response
Description:

	Missed fully qualifying ServerApiException in hashmap.
	Fixing it with this commit.
2012-03-08 11:19:13 -08:00
Vijayendra Bhamidipati 57c54e23d6 Bug 14060: Include a CloudStack error code in an Exception Response
Bug 13127: API error text refer to database ids instead of uuids

Code-Reviewers: Ewan Mellor, Kelven Yang

Description:

	1. A new class CSExceptionErrorCode has been added to utils.
	   It contains a list of error codes for each type of
	   Exception class. Use fully qualified package paths for
	   Exceptions in CSExceptionErrorCode.  We log any exception
	   name not found in the list of error codes for exceptions.

	2. Whenever we throw an exception exobj anywhere in the
	   CS code, the CSErrorCode is set in the base class
	   constructor.

	3. We add a new field csErrorCode in classes CloudException,
	   RuntimeCloudException, ExecutionException and
	   ExceptionResponse.

	4. Two places in ApiServer.java were wrongly modified when
	   putting in changes for bug 13127 to not throw an exception.
	   This has been corrected in this commit.
2012-03-05 17:39:09 -08:00
Vijayendra Bhamidipati 59631452b9 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Modify Exception handling to enable addition of multiple
	uuids in a single exception thrown by API functions. Both
	XML and JSON outputs will store all uuids and Fieldnames.
	This will make it easier to provide more information when
	an exception occurs - for example, a zone id, a cluster id,
	host id, and then a specific property id.
2012-02-27 17:55:03 -08:00
Vijayendra Bhamidipati bfe1122bc6 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Added a field name for the db id in the IdentityProxy class, and
	modified setProxyObject() to take an additional id name parameter.
	This will let us know the name of the uuid that we are returning.
	E.g.- domainId, zoneId, etc. The client can view this field in
	the json/xml output. Modified the JSON/XML serialization routines
	to append this new parameter to the serialized output for Exception
	Responses.
2012-02-27 17:55:01 -08:00
Vijayendra Bhamidipati c3fbe29cf8 Bug 13127: API error text refer to database ids instead of uuids
Description:

	1) Added a setProxyObject() method to CloudException and RuntimeCloudException
	2) Modified a bunch of throw exceptions in NetworkManagerImpl.java to call setProxyObject() before throwing an exception.
	3) Changed scope of ProxyIdentity attribute to protected.
	4) Added routines to ServerApiException to get/set IdentityProxy object, and
	   routine in RuntimeCloudException to get the Idproxy object.
	5) Modified the exception handling around the dispatcher and handlerequest()
	   to copy over the IdentityProxy information before rethrowing an exception
	   eventually back to handle().
	6) Removed duplicate IdentityProxy object in ServerApiException.
	   It was extending RuntimeCloudException which already had an
	   IdentityProxy object.
2012-02-27 17:54:56 -08:00
Vijayendra Bhamidipati 768d7a2a26 Bug 13127: API error text refer to database ids instead of uuids
Description:

1)	Moved RuntimeCloudException from api/ to utils/.

	Added simple constructor to RuntimeCloudException.

	Modified all classes that extended RuntimeException
	to extend RuntimeCloudException. These classes
	are listed below:

		ServerApiException
		CloudAuthenticationException
		CloudExecutionException
		AsyncCommandQueued
		HypervisorVersionChangedException
		RuntimeCloudException

2)	Added overloaded constructed to CloudException.
	Modified all classes that extend Exception to extend CloudException instead.
	These classes are listed below:

		ConcurrentOperationException
                ConflictingNetworkSettingsException
                ConnectionException
                DiscoveryException
                InsufficientCapacityException
                ManagementServerException
                ResourceUnavailableException
                VirtualMachineMigrationException
                AgentControlChannelException
                OperationTimedoutException.java
                UnsupportedVersionException.java
                UsageServerException.java
                UnableDeleteHostException.java
                AgentAuthnException.java
                HttpCallException.java
                ActiveFencingException.java
                ClusterInvalidSessionException.java
                GreTunnelException.java
                OvsVlanExhaustedException.java
2012-02-27 17:54:53 -08:00
U-CITRITE\vijayendra1 698c1ebe12 Bug 13127: API error text refer to database ids instead of uuids
Description:

1)	Adding two new classes, CloudException and RunTimeCloudException.
	The former extends Exception and the latter RunTimeException.
	These will be used by classes that formerly directly extended
	Exception and RuntimeException. These two classes have an attribute
	of type IdentityProxy to enable exceptions fill in db ids in separate
	attribute fields rather than in a string. Doing so will allow the
	serialization module (GSON for JSON and other for XML) to kick in
	and convert this db id to a uuid in ApiServer.java just before the
	JSON/XML responses are sent out.

2)	Moving IdentityProxy.java from api/ to utils/ since
	both CloudException and RuntimeCloudException refer to it.

3)	Changing references to IdentityProxy class from api/ to utils/.

4)	While rebasing to master, a new file was added, merging
	api/src/com/cloud/api/response/IsoVmResponse.java to this diff.
2012-02-27 17:54:50 -08:00
frank e0072edf4b Bug 13962 - CloudRuntimeException: Failed to update keypairs on disk: cannot create key file null/.ssh/id_rsa
using a flag instead of calculating timeout value. The monitor thread may have inaccurate execution time which
 may cause script forever hang

 status 13962: resolved fixed
 reviewed-by: Alex, Edison
2012-02-23 14:11:53 -08:00
frank d9019b3f70 Bug 13962 - CloudRuntimeException: Failed to update keypairs on disk: cannot create key file null/.ssh/id_rsa
Changes for Script.java:
1. Even the script is non-timeout one, set default timeout to one hour. This avoid a wrongn script forever hang
2. When InterruptedException happens, check if timeout is really reached, if not, continue

status 13962: resolved fixed
reviewed-by: Alex, Edison
2012-02-23 13:43:10 -08:00
kishan 9c5fb5f199 Bug 13741: Added new Config category Secure. Any config in secure category will encrypted along with the Hidden category configs
Status 13741: resolved fixed
Reviewed-By: Nitin
2012-02-17 16:42:32 +05:30
Edison Su 1ab89dd436 add cert chain in db, and also open the api to upload a cert chain 2012-02-09 14:56:40 -08:00
kishan 1fab4d1f72 Bug 13384: Added utility to change MS and DB secret key. Both database and db.properties are updated.
Status 13384: resolved fixed
Reviewed-By: Nitin
2012-02-07 20:03:06 +05:30
Alex Huang c42f50c4b0 Used a different way to allocate guest ip address. not in used yet. 2012-01-30 16:10:10 -08:00
frank f449cd7350 Bug 12771 - management-server.log displays ipmi related credentials in plain text
status 12771: resolved fixed
2012-01-09 14:42:01 -08:00
Kelven Yang 323a07d7e2 bug 12709: incremental fix - profiling management server clustering heartbeat activities 2012-01-05 14:59:45 -08:00
Alena Prokharchyk 0731dac370 bug 12399: introduced periodic thread that expires Project invitations
status 12399: resolved fixed
2011-12-09 12:21:41 -08:00
Edison Su 08ae2bc9ff fix loading agent in ssvm 2011-12-07 15:02:57 -08:00
frank 88e4cdc458 Bug 11939 - unify components.xml and components-premium.xml into components.xml
status 11939: resolved fixed
2011-12-07 11:34:57 -08:00
prachi 0769a3b3f3 API Server changes needed to read a properties file present within a jar provided in classpath. 2011-11-29 18:02:19 -08:00
Alena Prokharchyk ecd7004f15 bug 11978: don't allow passing -, + and spaces for instance.name config param
status 11978: resolved fixed
2011-11-28 11:52:46 -08:00
kishan e86b03c2e6 bug 12187 : Handle empty strings while encrypting and decrypting
status 12187 : resolved fixed
reviewed-by: Abhi
2011-11-28 22:20:44 +05:30
Alex Huang 3d6a87867a print out the statement on closing for better debugging output 2011-11-18 14:29:05 -08:00
Sheng Yang 257836284a bug 11904: Fix regression caused by OpenJDK 1.6.0 security fix
It’s due to an security fix of OpenJDK 1.6.0 added by Redhat. Here is excerpt
of [RHSA-2011:1380-01] Critical: java-1.6.0-openjdk security update(
https://www.redhat.com/archives/rhsa-announce/2011-October/msg00011.html)

    A flaw was found in the way the SSL 3 and TLS 1.0 protocols used block
    ciphers in cipher-block chaining (CBC) mode. An attacker able to perform a
    chosen plain text attack against a connection mixing trusted and untrusted
    data could use this flaw to recover portions of the trusted data sent over
    the connection. (CVE-2011-3389)

    Note: This update mitigates the CVE-2011-3389 issue by splitting the first
    application data record byte to a separate SSL/TLS protocol record. This
    mitigation may cause compatibility issues with some SSL/TLS implementations
    and can be disabled using the jsse.enableCBCProtection boolean property.
    This can be done on the command line by appending the flag
    "-Djsse.enableCBCProtection=false" to the java command.

To our knowledge, there are two condition need to be met to trigger this bug:
1.    Using old keystore generated by mgmt. server 2.2.8, which is signed with
SHA1withDSA. Any version later than 2.2.8 would generate keystore signed with
SHA1withRSA. RSA one seems fine with us so far.
2.    Use OpenJDK >=1.6.0.

The reason is, due to the security fix above, the assumption that one packet
would contain only one SSL record is broken. The decrypted data maybe only
contained the first byte of original application data. Then result in buffer
underflow when mgmt server want to read more from it.

To workaround it, according to the message above, add
"-Djsse.enableCBCProtection=false" to tomcat6.conf JAVA_OPTS line would work.
Notice the parameter would only work with latest version of OpenJDK, so simply
add it to the all setup would not work.

This patch provided a fix for it.

status 11904: resolved fixed
2011-11-16 18:40:14 -08:00
Kelven Yang bf4076b559 Fix the problem in retrieving default host IP on windows platform 2011-11-14 11:33:51 -08:00
Alex Huang ddbcd01f56 fixed up unit test 2011-11-11 14:15:13 -08:00
Alex Huang f6fcaa49ec Merge complete except for virtualnetworkappliancemanager 2011-11-10 15:18:16 -08:00
alena a32c4f1ec6 Fixed unit tests 2011-11-03 14:02:53 -07:00
Kelven Yang 924e556c95 bug 6745: Using UUID instead of integers - for all commands 2011-11-03 07:34:00 -07:00
frank cef30956e9 Merge branch 'newagentmgr'
Conflicts:
	agent-simulator/src/com/cloud/api/commands/ConfigureSimulator.java
	ovm/src/com/cloud/ovm/hypervisor/OvmDiscoverer.java
	server/src/com/cloud/agent/manager/AgentManagerImpl.java
	server/src/com/cloud/capacity/CapacityManagerImpl.java
	server/src/com/cloud/network/F5BigIpManagerImpl.java
	server/src/com/cloud/network/JuniperSrxManagerImpl.java
	server/src/com/cloud/resource/ResourceManagerImpl.java
	server/src/com/cloud/server/ManagementServerImpl.java
	server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java
	server/src/com/cloud/vm/VirtualMachineManagerImpl.java
	utils/src/com/cloud/utils/db/GenericDao.java
2011-10-27 11:09:56 -07:00
Edison Su 92eaf49f29 Add storage migration 2011-10-24 15:59:47 -07:00
kishan 8487803f5a bug 5822, 10783: Security enhancements initial checkin. Added encryption support to db.properties and some DB values. 2011-10-24 18:02:31 +05:30
Abhinandan Prateek ed2816051a bug 11354: enabled cache for listBy Dao calls and specifically for listBySecurityGroup 2011-10-24 10:50:44 +05:30
kishan 83b4d2f7f9 bug 5822, 10783: Security enhancements initial checkin. Added encryption support to db.properties and some DB values. 2011-10-24 10:26:02 +05:30
Abhinandan Prateek bd774ab7a7 bug 11354: query cache option is being enabled at DAO level. To use the cache sql paramter query_cache_type should be set to 2 and query_cache_size should be set to a value greated than 40kb. These can be set in my.ini. There are more tuning paramters which can be fine tuned and they are mentioned here http://dev.mysql.com/doc/refman/5.5/en/query-cache-configuration.html 2011-10-20 13:23:14 +05:30