Commit Graph

428 Commits

Author SHA1 Message Date
Sheng Yang 685af150bc S2S VPN: Use coma instead of semicolon for separating cidr list 2012-08-08 10:37:26 -07:00
Alena Prokharchyk 44ae760257 VPC: CS-15850 - don't unplug the nic for public network when there are existing ips in the same vlan having network rules 2012-08-06 17:37:16 -07:00
Alena Prokharchyk ddb9e498f7 VPC: unittest preparation 2012-08-06 16:31:32 -07:00
Sheng Yang 064198eef9 S2S VPN: Fix one typo at NetUtils 2012-08-06 15:26:44 -07:00
Sheng Yang c2250fecf7 S2S VPN: CS-15511: Add PFS support for VPN connection 2012-08-02 18:45:03 -07:00
Alena Prokharchyk 967ff1141b 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 2012-08-02 17:06:31 -07:00
Alena Prokharchyk 3e9eea42f0 VPC: CS-15813 - ICMP type and code validation 2012-08-01 19:49:45 -07:00
Sheng Yang 2ed8c250d0 S2S VPN: Update the supported crypto list
We would support 3DES, AES128, AES192, AES256.
2012-07-30 16:43:20 -07:00
Vijay 21e13657b4 AutoScale.
All API commands with separate service layer for AutoScale.
  Not tested.
2012-07-24 09:57:10 +05:30
Sheng Yang 79f7f8cc1f CS-15649: Remove DES from s2s vpn support policy
DES is considered INSECURE.
2012-07-20 10:53:03 -07:00
Sheng Yang 8331483306 CS-15511: Not allow pfs parameter for customer VPN gateway 2012-07-19 15:09:35 -07:00
anthony 2557315a5a VPC: CS-15580 - don't allow gateway for VPC guest network to be equal to the cidr broadcast ip 2012-07-13 18:20:30 -07:00
Alena Prokharchyk b145029718 VPC: CS-15580 - don't allow gateway for VPC guest network to be equal to the cidr subnet 2012-07-13 17:06:10 -07:00
Sheng Yang 8212de6f94 CS-15513: Fix group 5 of s2s vpn 2012-07-10 10:31:25 -07:00
Vijayendra Bhamidipati 06a9ef7923 CS-15217: Security: Malicious user is able to get the size of the cloud by enumerating IDs
Description:
	More changes to remove DB IDs from exception messages.
2012-07-06 15:58:12 -07:00
Vijayendra Bhamidipati f1ec4fddd3 CS-15217: Security: Malicious user is able to get the size of the cloud by enumerating IDs
Description:

	As part of the fix for Bug CS-13127, a new overloaded function,
	addProxyObject() was added to facilitate transparent db id to
	uuid conversions when db IDs were added to exceptions that were
	thrown in the Cloudstack mgmt server code. However, it turns out
	that there are quite many db IDs still in the code that are
	being directly embedded in the String message that is passed
	during exception creation.

	In this commit, we modify the default constructor of
	InvalidParameterValueException so that it takes a second
	argument of type List<IdentityProxy>. This will help developers
	see that there is a second parameter required, and make them
	look into what that parameter is about. Hopefully, this will
	stop db IDs from being embedded into the exception message.

	The parameter can be set to null though, since there are many
	places in the code that don't embed any DB IDs in the exception.

	This is still a WIP, so the older default constructor for
	InvalidParameterValueException has not been removed yet. When
	all instances of throw new InvalidParameterValueException()
	have been moved over to the new default constructor, the old
	one will be removed, else compilation will break. The reason
	for having to do this in batches is that there are way too
	many places in the code that throw exceptions, and they all
	cannot be covered in a single commit without it taking much
	time.

	In following commits, all other exceptions will be changed
	in the same way as InvalidParameterValueException.
2012-07-05 16:48:36 -07:00
Sheng Yang 52e80e5fb0 CS-6840: Add commands for site-to-site vpn 2012-06-27 19:05:41 -07:00
Vijayendra Bhamidipati 73a3c8f496 Bug CS-15372: IdentityProxy info should be copied over during exception handling in API layer for create(), like it is done in execute().
Description:

	1. Added exception processing for uuid lists in exceptions,
	   for commands of type BaseAsyncCreateCmd.
	2. Added nullpointer check in addProxyObject().
	3. Miscellaneous whitespace reformatting for git patching.
2012-06-27 15:33:19 -07:00
Vijayendra Bhamidipati b9263b0c51 Merge branch '3.0.x' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 3.0.x 2012-06-18 13:01:11 -07:00
Vijayendra Bhamidipati e03ed60540 Bug 13127: API error text refer to database ids instead of uuids
Bug CS-14448: Wrong error message on using the createVlanIpRange cmd

Cherry-picking from master for bug 14448 into 3.0.x. Resolved
conflicts encountered during cherry-picking.

Description:

	Adding overloaded addProxyObject() function to CloudException
	and RuntimeCloudException classes and using this function
	to stuff exceptions with IDs, to reduce code footprint.

Conflicts:

	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/resource/ResourceManagerImpl.java
2012-06-18 12:55:44 -07:00
anthony 3b2b8fc143 VPC: fix VPC cidr check 2012-06-18 11:40:59 -07:00
Vijayendra Bhamidipati 79abb862f3 Bug 13127: API error text refer to database ids instead of uuids
Bug CS-14448: Wrong error message on using the createVlanIpRange cmd

Cherry-picking from master for bug 14448 into 3.0.x.

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.

Conflicts:

	server/src/com/cloud/server/ManagementServerImpl.java
2012-06-18 11:39:36 -07:00
Alena Prokharchyk aaf0d24a83 Merge branch 'vpc-3.0.x' into 3.0.x
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/AssociateIPAddrCmd.java
	api/src/com/cloud/api/commands/EnableStaticNatCmd.java
	api/src/com/cloud/event/EventTypes.java
	api/src/com/cloud/network/NetworkService.java
	api/src/com/cloud/network/rules/RulesService.java
	client/tomcatconf/commands.properties.in
	core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
	scripts/vm/hypervisor/xenserver/xenserver56fp1/patch
	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/consoleproxy/ConsoleProxyManagerImpl.java
	server/src/com/cloud/network/NetworkManagerImpl.java
	server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
	server/src/com/cloud/network/rules/RulesManagerImpl.java
	server/src/com/cloud/server/ManagementServerImpl.java
	server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
	server/src/com/cloud/upgrade/dao/Upgrade2214to30.java
	server/test/com/cloud/network/MockNetworkManagerImpl.java
	server/test/com/cloud/vm/MockVirtualMachineManagerImpl.java
	setup/db/create-schema.sql
	wscript
2012-06-14 19:04:59 -07:00
Alena Prokharchyk 5c5a2adb90 Completed API / Management server code for Resource tags feature. UI is yet to be done 2012-06-14 15:17:11 -07:00
Vijayendra Bhamidipati eb2d05c6c6 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-11 16:36:02 -07:00
Devdeep Singh 8797275010 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-26 04:45:18 +05:30
Vijayendra Bhamidipati 20f49558c5 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Removing the CiscoNexusVSMService class since
	we don't use it anywhere.
2012-05-24 15:07:37 -07:00
Devdeep Singh b041f41881 CS-9919: Adding helper routines to query details of a port profile and
associated policy maps. Also updating the error message logs.
2012-05-22 21:38:51 +05:30
Devdeep Singh 1490527d8f 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-17 18:33:54 +05:30
Sateesh Chodapuneedi 9929a3bc70 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Increasing the window for xmlstream.
2012-05-14 18:54:46 -07:00
Devdeep Singh 178a3a86d3 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Do not set the access mode of an interface if vlanid is zero.
2012-05-14 18:53:06 -07:00
Devdeep Singh 0a698a7af8 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-14 18:51:37 -07:00
Devdeep Singh d26d86cd26 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding apis to create service policies and
	associate them with a port profile.
2012-05-14 18:50:23 -07:00
Devdeep Singh 8d5a3276de CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Made changes to persist the vsm configuration
	after updating it.
2012-05-14 18:44:44 -07:00
Devdeep Singh b037147f98 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding a helper routine for modifying port
	profile configuration.
2012-05-14 18:44:08 -07:00
Devdeep Singh 91e00988d4 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-14 18:41:31 -07:00
Devdeep Singh 57de553728 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-14 18:25:10 -07:00
Devdeep Singh 12a85ea0c5 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Removing unused classes and references to them.
2012-05-14 18:23:26 -07:00
Devdeep Singh f94a5710a9 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Updated the rpc request generation logic for
	creating and deleting port profiles.
2012-05-14 18:22:33 -07:00
Vijayendra Bhamidipati f43968c4a9 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.
2012-05-14 18:21:21 -07:00
Devdeep Singh 264caccad9 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-14 18:19:18 -07:00
Vijayendra Bhamidipati e9d1bfbd3f 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.
2012-05-14 18:15:47 -07:00
Vijayendra Bhamidipati aaabd427f6 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-14 18:15:11 -07:00
Vijayendra Bhamidipati f601db1304 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-05-01 13:48:15 +01:00
Vijayendra Bhamidipati bea85d47a7 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-05-01 13:28:21 +01:00
Vijayendra Bhamidipati 094f01be41 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-05-01 13:28:20 +01:00
Vijayendra Bhamidipati b4cefb4cc6 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-05-01 13:28:16 +01:00
Vijayendra Bhamidipati efdaa4d110 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-05-01 13:21:44 +01:00
U-CITRITE\vijayendra1 89db087981 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-05-01 13:21:42 +01:00
prachi 9a4f5f90a2 Fix error from merge 2012-04-30 17:08:36 -07:00