Changes for implicitly dedicating a resource. It includes a following:
1. A new implicit planner which extends the functionality provided by FirstFitPlanner.
2. Implicit planner can be used in either strict or preferred mode. In strict mode it tries to deploy a vm of a given account on a host on which vms of the account are already running. If no such host is found it'll search for an empty host to service the request. Otherwise the deploy vm request fails.
3. In preferred mode, if a host which is running vms of the account or an empty host isn't found, the planner then tries to deploy on any other host provided it isn't running implicitly dedicated strict vms of any other account.
4. Updated the createServiceOffering api to configure the details for the planner that the service offering is using.
5. Made db changes to store the service offering details for the planner.
6. Unit tests for testing the implicit planner functionality.
7. Marvin test for validating the functionality.
CLOUDSTACK-2552. Modify AWSAPI to decrypt db values using the decrypted database_key and not management_server_key
CLOUDSTACK-2513: VPN tests refer to invalid connection.user in cloudConnection

cloudConnection object should always have "user" and "passwd" attributes.
And they are "None" while creating userAPIClient. As we already
have "user" and "password" for mgmt server.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
CLOUDSTACK-2478: Fix test_volumes.py script for BVT failures

removed storage type in compute offering and disk offering

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
CLOUDSTACK-2542: Fix router test for basic zone

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
CLOUDSTACK-2483: Fix base.py migrate volume method

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
Fixed CLOUDSTACK-2081 Volume which is added thru upload volume is failed to attach to the instance saying Volume state must be in Allocated, Ready or in Uploaded state( Though uploaded Volume state is uploaded)
CLOUDSTACK-2122. Virtual machine id should be a required parameter for findHostsForMigration api. Fixing it.
iCLOUDSTACK-2321
Fix the response of scaleVMCmd
Add Scale System vm command
portable IP
rbd: Allow RBD disks to be attached to a Instance
CLOUDSTACK-2102: Anti-Affinity - Even after reserved capacity has been released for a Vm in "Stopped" state , we are not allowed to deploy new Vms as part of same anti-affinity group in the last_host_id where the stopped Vm was running.

Changes:
Do not add the last_host_id of a Stopped VM to avoid set, if the VM has been stopped for more that capacity.skip.counting.hours time limit
CLOUDSTACK-2070: Anti-Affinity - When Vm deployment fails because of not being able to satisfy the anti-affinity rule , user should be provided with more informative message.

Changes:
- There is no good mechanism currently to figure out if the  deployment failed due to affinity groups only
- We can just hint the user that the deployment might have failed due to the affinity groups and ask to review the input
CLOUDSTACK-751: 41-42 DB upgrade - insert new global config blacklisted.routes
CLOUDSTACK-2365: Anti-Affinity - As admin , we are allowed to deploy a Vm in an affinity group that belongs to different user.

CLOUDSTACK-2349: Anti-Affinity - As admin user , using updateVMAffinityGroup() , we are allowed to update the affinity group of a Vm (that belongs to a regular user) to be set to admin's affinity group.

Changes:
- Even for root-admin make sure that the affinity group and the VM belong to same account
Better parse domain XMLs so network devices can be detached as well
CLOUDSTACK-2554: CloudStack fails to load XCP 1.6 hypervisors

Missing default constructor fails the agent manager reloading the XCP
resource on reboot of management server. This is fixed by using the
default constructor as do other Xen resources and include a new resource
ala XenServers for XCP1.6.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
Fixing multiple minor annoyances:

1. Keeping the description consistent - Memory not RAM when referring to
overcommit
2. getters And setters grouped, provided right casing.
3. Removed wildcard imports

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
CLOUDSTACK-2554: Ensuring that we honor hypervisor xen's memory constraints

When setting memory constraints on Xen guests we should honor:
static-min <= dynamic-min <= dynamic-max <= static-max

Our VmSpec while allows the guests to like between dynamic-min and
dynamic-max the memory set by the resource set the static min to be
equal to the dynamic max. This restricts the hypervisor from ensuring
optimized memory handling of guests.

see: http://wiki.xen.org/wiki/XCP_FAQ_Dynamic_Memory_Control#How_does_XCP_choose_targets_for_guests_in_dynamic_range_mode.3F

Another fix was related the restrict_dmc option. when enabled (true)
this option disallows scaling a vm. The logic was reverse handled
allowing scaling when restrict_dmc was on. This control flow is now
fixed.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
CLOUDSTACK-2554: Incorrect compute of minmemory and cpu

23e54bb0 introduced multiple hypervisors support for cpu and memory
overcommit. Here the HypervisorGuru base which determines the min, max
range for the memory for all hypervisors computes the minCpu using the
MemoryOverCommit ratio and minMemory using the CpuOverCommit ratio.

Minor typo/logic issue but massive damage across all HV if enabled ;)

Signed-off-by: Prasanna Santhanam <tsp@apache.org>