399 Commits

Author SHA1 Message Date
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