Commit Graph

5009 Commits

Author SHA1 Message Date
Alena Prokharchyk 05609b9074 CS-14904
Fixed the bug where vm_instance.ha_enabled wasn't updated during service offering upgrade
2012-05-15 12:35:48 -07:00
Sateesh Chodapuneedi b82c8b87e1 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Added VSM credentials to AddClusterCmd(optonal params only).
Cleanup.
2012-05-15 09:35:32 -07:00
Nitin Mehta 548568558c bug CS-14814: Do not allow attaching volume to a stopped vm for an uploaded volume. Make changes to accomodate volume attaching for a vm created in Stopped state. 2012-05-15 18:26:17 +05:30
Sateesh Chodapuneedi c3c326b8b5 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Instance configuration to join distributed vNetwork.
2012-05-14 18:57:20 -07:00
Vijayendra Bhamidipati a2141fbe35 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Missed out a file in previous commit when adding
	the new API getCiscoVSMByClusterId. Stub file was
	added by Sateesh to prevent breakage. Putting the
	file in in this commit plus better exception
	handling.
2012-05-14 18:56:24 -07:00
Sateesh Chodapuneedi 014773e7e4 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Added command class GetCiscoVSMByClusterIdCmd.
2012-05-14 18:56:03 -07:00
Sateesh Chodapuneedi c9331e5d21 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Portprofile shaping policies will be fetched
	from nexus vswitch instead of vcenter.
	ACLs and Policies won't be synced to vCenter.
	Get physical network label while adding cluster.
	Cleanup.
2012-05-14 18:55:08 -07:00
Vijayendra Bhamidipati 4f3eed847a CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Adding command getCiscoVSMByClusterId to
	retrieve a VSM associated with a cluster.
2012-05-14 18:54:22 -07:00
Sateesh Chodapuneedi ac74adb465 CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	Retreving physical network configuration from
	database. Passing configuration down to resource.
	Cleanup.
2012-05-14 18:52:30 -07:00
Vijayendra Bhamidipati f8437196aa CS-9919 Support for Nexus Swiches (Cisco Vswitches)
Description:

	1. Removed CiscoNexusVSM.java.

	2. Put in invocation of Netconfhelper's
	   connect method to a VSM, in
	   CiscoNexusVSMDeviceManagerImpl.java.
2012-05-14 18:48:42 -07:00
Sateesh Chodapuneedi 413a1112d3 CS-9919 - Support for Nexus Swiches (Cisco Vswitches)
Description:

	Code changes to manage Cisco Nexus 1000v in CloudStack.
	VmwareResource has been modified to leverage Nexus vSwitch.

	Providing following global configuration parameters,

vmware.use.nexus.vswitch -
	This would decide whether Nexus vSwitch in the VMware
	cluster environment would be used/managed by CloudStack
	for it's network infrastructure needs.

vmware.guest.network.vswitch.type -
	This setting would enable CloudStack to use Nexus vSwitch
	in the VMware cluster environment for guest traffic.

vmware.private.network.vswitch.type -
	This setting would enable CloudStack to use Nexus vSwitch
	in the VMware cluster environment for private traffic.

vmware.public.network.vswitch.type -
	This setting would enable CloudStack to use Nexus vSwitch
	in the VMware cluster environment for private traffic.

Functional Specification -
	http://wiki.cloudstack.org/display/RelOps/Cisco+Nexus+1000v+Support+in+CloudStack+-+Functional+Specification

Documentation / README for usage instructions -
	http://wiki.cloudstack.org/display/RelOps/Configuration+instructions+for+CloudStack+Deployment+with+Nexus+vSwitch
2012-05-14 18:45:25 -07:00
Vijayendra Bhamidipati de30d66fd8 Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	1. Added the PortProfile infrastructure:

	    a. PortProfileVO : The VO class to represent a db
	    record of the table port_profile. Each db record
	    represents one port profile.

	    b. PortProfileDao: The interface that declares search
	    functions on the port_profile table.

	    c. PortProfileDaoImpl: The class that defines the
	    interfaces declared in PortProfileDao.

	    d. PortProfileManagerImpl: The class that contains
	    routines that will add or delete db records from
	    the port_profile table. If you want to create/delete
	    a portprofile, call functions from this class.

	    e. Changes to create-schema.sql to create the port_profile
	    table.

	2. Cleaned up code:

	    a. Removed a number of unused Dao and Manager objects in
	    CiscoNexusVSMDeviceManagerImpl.

	    b. Removed the ListCiscoNexusVSMNetworksCmd command.

	    c. Removed a bunch of import statements in a few files.
2012-05-14 18:42:29 -07:00
Vijayendra Bhamidipati 978732ead9 Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	1. Modify addCiscoNexusVSMCmd to enable a VSM
           by default, when it is added to a cluster.

	2. Put in two new APIs exposed to the user -
                a. EnableCiscoNexusVSMCmd
                b. DisableCiscoNexusVSMCmd

        Disabling a VSM does not delete it. It only
        prevents the Management Server from using that
        VSM. This is useful if the VSM is in
        maintenance mode.
2012-05-14 18:41:02 -07:00
Vijayendra Bhamidipati cff3c78d2f Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

        1. Put in invocation to the deleteCiscoNexusVSM()
	   function in the deleteCiscoNexusVSM command
	   chain.

        2. Put in additional check for physical servers
	   present in a cluster that still is tied to a
	   VSM. The previous check would query for all
	   hosts in a cluster, causing the check to see
	   if a cluster has any physical servers in it
	   to always fail and thus block the VSM from
	   getting deleted. By putting in a check to see
	   if a host if of type "Routing", we refine this
	   search to only hypervisors.

        3. Other miscallaneous code + cleanup.
2012-05-14 18:39:37 -07:00
Vijayendra Bhamidipati 685427b1b7 Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

        1. Changed AddCiscoNexusVSMCmd to:
             a. Extend BaseCmd instead of BaseAsyncCmd.
             b. Take in more required parameters (viz
                vCenterDCName and vCenterIpAddress)

        1a. Changed DeleteCiscoNexusVSMCmd to also
            extend BaseCmd.

        2. Put in changes that will ensure that
           When a VSM is added, it is disabled by default.

        3. Fixed code that was leading to exceptions
           related to DB reads/writes to VSM related tables.

        4. Added new API Constants in ApiConstants.java.
           NOTE - Always initialize new attributes in
           ApiConstants.java to values in small case.
           Never put in upper case there. Also regardless
           of what names you give attributes in the
           *Cmd.java's class, you pass in parameters via
           API calls by specifying <key>=<value> where the
           <key> is taken from the value you specified in
           ApiConstants.java.

        5. Modified the addCiscoNexusVSM() function in
           CiscoNexusVSMDeviceManagerImpl.java to write VSM
           records to the db.
2012-05-14 18:25:55 -07:00
Vijayendra Bhamidipati ed72fbe86e CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Fixed type of argument taken by AddCiscoNexusVSMCmd
	from ZONE_ID to CLUSTER_ID.
2012-05-14 18:21:55 -07:00
Vijayendra Bhamidipati 14ae4adbcd CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	Fixing failure to load ClusterVSMMapDao by
	putting in a constructor that takes no
	arguments, inClusterVSMMapVO.
2012-05-14 18:20:39 -07:00
Vijayendra Bhamidipati 8362c89782 CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	1. Missed replacing older table name for VSMs in a few
	   files (changed the name from
	   external_virtual_switch_management_devices to
	   virtual_supervisor_module). Fixed that in this commit.

	2. Missed adding the new Dao ClusterVSMMapDao in the Dao
	   loading in DefaultComponentLibrary. Fixed.

	3. Fixed wrong searchbuilder options passed to ipaddrSearch
	   in CiscoNexusVSMDeviceDaoImpl.
2012-05-14 18:18:26 -07:00
Vijayendra Bhamidipati 79f3d8b6c4 Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	1. Added a new VO class to represent a new table
	   "cluster_vsm_map". The class is ClusterVSMMapVO
	   in ClusterVSMMapVO.java. This table has only
	   two fields - clusterId, VSMId. The clusterId can
	   occur only once. But the same VSMId can be tied
	   to different clusterIds.

	2. Added the Dao interface + implementation of the
	   interface. This provides the functions required
	   to populate objects of type ClusterVSMMapVO with
	   records from the cluster_vsm_map table. The
	   interface is defined in ClusterVSMMapDao.java,
	   and the implementation is in ClusterVSMMapDaoImpl.java.

	3. Changed the table name that represents the VSM to
	   "virtual_supervisor_module" from the earlier overly
	   generic "external_virtual_switch_management_devices".

	4. Added search/remove functions to the Dao of the VSM.
	   This is the Dao for the Cisco Nexus VSM -

		CiscoNexusVSMDeviceDao:CiscoNexusVSMDeviceDaoImpl
		 --> This is the Dao Implementation that would let
		     us query/update records on the
		     "virtual_supervisor_module" table that contains
		     the records of all the VSMs that are added to
		     the Management Server.

NOTE::
======
These were some of the changes made as part of the previous commit (#7):

	1. Renamed CiscoNexusVSMResource.java to CiscoNexusVSM.java.

	2. Changed it to not implement a true resource, but to be
	   just a class providing functionality to talk to a VSM.

	3. Modified the AddCiscoNexusVSMCmd class to take in clusterId
	   instead of zoneId + your fix of the String to Long.
2012-05-14 18:17:08 -07:00
Vijayendra Bhamidipati 7e8a8c2d3e Bug CS-9919: Support for Nexus Swiches (Cisco Vswitches)
Description:

	This is work in progress. This set of changes will not
	compile. Checking in for team wide code sync up.

	Changes are underway to test if VMWareResource can be
	leveraged to talk to the VSM, instead of creating a
	new resource for the VSM, like we've been doing up
	until now.
2012-05-14 18:16:34 -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
frank b4b10dc5bc don't call _secMgr.generateSetupCommand each time copying template
it will reboot httpd making in processing copy fail
2012-05-14 14:14:39 -07:00
Pranav Saxena 039f48e096 CS-14873 : Authentication errors
reviewed-by: brian
2012-05-14 11:14:04 -07:00
Alena Prokharchyk ca17d35230 CS-14692: don't allow to remove account specific ip range when it has sourceNat ip address, and associated with non-removed Guest network 2012-05-14 10:13:34 -07:00
Nitin Mehta b2c38acb4e bug CS-14785: Allow attaching the volume for Uploaded volume. Also have transition fo delete volume. 2012-05-14 16:41:56 +05:30
Alena Prokharchyk 5074227858 CS-14783
Fixed limit check when acquire public ip range for the account.
2012-05-11 15:39:59 -07:00
Vijayendra Bhamidipati ab6c8f7986 Bug CS-14853: CloudStack list APIs are listing incorrect IDs for all the entities when API response set to "xml". works fine for "json"
Bug 14071: queryAsyncJobResult in xml format gives incorrect UUIDs back

Description:

	CS-14853 is the same bug as 14071, but seen in Bonita branch
	owing to the fix not being merged from master. So putting in
	the same fix to 3.0.x branch. Description of fix follows.

        Incorrectly removed part of the XML serializer that serialized
        the IdentityProxy object in normal responses, when putting in
        support for serialization of lists of IdentityProxy objects in
        exception responses as part of the code changes put in for bug
        13217, resulting in this bug. Putting it back in place.
2012-05-11 14:44:24 -07:00
Alena Prokharchyk 04b0aea11b CS-14685: Added customdiskofferingmaxsize to the listCapabilities response 2012-05-11 13:45:19 -07:00
Nitin Mehta cf23d2e63f bug CS-14785: Improvements to volumes sync so that it can recover from any error. Introduced new state UploadOp which signifies that the volume os on secondary and the status would be picked up from volume host ref table. 2012-05-11 11:38:07 +05:30
Salvatore Orlando 3131b2c319 Merge branch '3.0.x' of ssh://git.cloud.com/var/lib/git/cloudstack-oss into 3.0.x 2012-05-09 13:07:37 +01:00
Salvatore Orlando f04b62cadc CS-14741: Fixing upgrade script from 2.2.14 to 3.0 2012-05-09 13:05:34 +01:00
Rajesh Battala 44f3846168 Modified S3RestServlet to turn down request if enable.s3.api is false. Changed upgrade script for S3 API Feature 2012-05-09 15:25:39 +05:30
prachi 948aa45050 CS-14753: When Vm is deployed with a Security Group , it also gets associated with the default security group.
Changes:
- StartVM needed to be changed to add default security group only when none is present.
- DeployVm: createAdvancedSecurityGroupVirtualMachine changed to follow the same rule - add default SG only if none is specified.
2012-05-08 15:51:06 -07:00
Nitin Mehta 56f4dec1e2 bug CS-14785: String equality should be through equals function....what was i thinking !!!. 2012-05-08 14:38:38 +05:30
prachi 3d4ccc0a96 CloudStack listTemplatePermissions should add the owner of the template to the list of users having launchPermissions.
If the template is Public, we need not add the owner explicitly.
2012-05-07 11:40:17 -07:00
Naredula Janardhana Reddy e75520259d Bug 14120: Enabling SNAT for all the public NICs.
Summary of changes:
    - snat flag is set to true if it is first ip of the NIC.

reviewed-by: Abhi
2012-05-07 09:59:44 +05:30
Nitin Mehta 8ac10c5941 bug CS-14739: Check for the volume and vm hypervisor compatibility before attaching the volume to vm in case the volume is on secondary storage. 2012-05-04 16:30:08 +05:30
kishan 32085c960e bug CS-14763: Added missing 301 to 302 path for 2.2.10 upgrade
status CS-14763: resolved fixed
reviewed-by: Abhi

Conflicts:

	server/src/com/cloud/upgrade/PremiumDatabaseUpgradeChecker.java
2012-05-04 16:09:28 +05:30
JohnZ ef2c7423f1 S3 API merged branch 2012-05-02 15:51:10 +01:00
Salvatore Orlando 486d962f09 CS-14724 : Making the default network label configurable, improving exception management
Please also see notes added to wiki.cloudstack.org/display/QA/Open+vSwitch+Tunnel+Manager
2012-05-02 13:14:47 +01:00
Nitin Mehta 7a06da8520 bug CS-10789: Some more code to make the Uploav volume more robust. 2012-05-02 11:24:46 +05:30
Nitin Mehta 540f4e1431 bug CS-10789: Put zone id in the volumehost ref table. make list volume to show the percent uploaded. 2012-05-01 18:36:31 +05:30
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
Kelven Yang cd13762e44 Console proxy refactoring incremental check-in - new VNC protocol implementation 2012-05-01 13:45:15 +01:00
Alena Prokharchyk 0077234576 Fixed unittest and some issues with 2.2.14-3.0 upgrade 2012-05-01 13:34:05 +01:00
Vijayendra Bhamidipati 1d749bb9d3 Bug 13127: API error text refer to database ids instead of uuids
Description:

	Modified the IdentityTypeAdapter's custom serializer to
	identify whether this is an exception response that is being
	serialized, by checking if the idFieldName is set. If so,
	serialize both uuid and the uuidProperty (for eg, zoneId and
	"zoneId" (string)) and pass back the json representation of that.

	Modified XML serializer also to build a list of uuids+fieldnames.

	Introduced a new field "cserrorcode" in ExceptionResponse. This
	refers to an error code that can be according to the specific
	Exception being thrown. This will be serialized as usual. There
	shouldn't be any need to do a db lookup for conversion for these
	error codes.
2012-05-01 13:28:22 +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 7ea32a4471 Bug 13127: API error text refer to database ids instead of uuids
Description:

	1) Put in an IdentityProxy object in the ExceptionResponse class.
	   This allows us to copy over the IdentityProxy object contained
	   in the exception caught by handlerequest() when thrown by the
	   command's execute() method, into the Response object that is
	   prepared to return an exception response to the calling API
	   invocation.

	2) Modified the GSON serialization method to conver the entire
	   exception object into JSON format and not just the error text.

	3) Modify the updateDomain API to populate the exception it throws
	   upon detecting a duplicate domain to include the tablename and
	   domain db id in the exception's IdentityProxy object.

	NOTE:
	1) We can modify the base exception classes and the ExceptionResponse
	   class to contain a list of IdentityProxy objects rather than a
	   single one.
	2) We will need to modify all commands such that wherever applicable
	   (wherever a db id is involved), they populate the IdentityProxy
	   object(s) before throwing an exception.
2012-05-01 13:28:19 +01:00