CLOUDSTACK-4379: Reset VM states when host is removed from cluster

   If you shut down the agent while VMs are running, the management
server assumes that the VMs are continuing to run. You can then
delete the host while it is in 'disconnected' state, and those VMs
will be unusable, forever in running state. They can't change state
because the host no longer exists. This patch checks for any VMs
that may have been tied to the removed host and resets their state
so that cloudstack can continue to manage them.
CLOUDSTACK-4237 [Autoscale] Account deletion doesn't delete all autoscaled LB rules created by the account
CLOUDSTACK-1682. DOC. Fix parameter name in overview doc for reset volume on VM reboot. Add cross-reference to the detailed how-to section.
CLOUDSTACK-4384: Switch back to CLOUD_DB after simulator processing

Simulator should revert back to CLOUD_DB after its operations on
SIMULATOR_DB or the cloudstack connections go to the simulator instead
of cloud.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 3d39716c8fed2b27edbd4475a7e0915b1200123c)
CLOUDSTACK-1316 location of cloud-set-guest-password updated
CLOUDSTACK-4132 current dnsmasq config does not allow guest virtual machines(clients) to update its hostnames with a DNS server

Introducing the option dhcp-client-update fails if the dnsmasq version is less than 2.6 (like in older templates).
Added a check for the version in cloud-early-config. will add dhcp-client-update option in the config file only
if the dnsmasq version is 2.6 and above.

Signed-off-by: Jayapal <jayapal@apache.org>
CLOUDSTACK-4385 : [ZWPS]Across the cluster live migration of VM on zone wide primary storage pool fails

If all the VM's volumes are on zone wide primary storage pool then live migration of the VM would not involve storage migration. Hence MigrateVM API would be called against MigrateVMWithVolume. So far PrepareForMigrationCommand handled scenarios of VM moving across hosts within a cluster, but with zone wide primary storage in picture this command need to handle scenarios of VM moving across clusters. Try to find the VM in datacenter if not found within cluster.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
CLOUDSTACK-1316 some minor edits
CLOUDSTACK-4393 typo fixed
Revert "CLOUDSTACK-4393 typo fixed"

This reverts commit b9f029857bdf709bb3b3b50d75b028b0760dc598.
CLOUDSTACK-4394: remove cleanups for offerings

offerings do not need to be cleaned up

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit b9c2471cfc5e051db4478783c6928f6e0c5a1f7a)
CLOUDSTACK-4225: Fix template references in setUpClass

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 7768613edc4f9ae0787e555f2bf4bd2fb42a4c6e)
CLOUDSTACK-4396: Invalid case comparison leaves egress rule unprogrammed

Thereby failing the wget for the cloud-setup-guest-password script which
in turn fails the test.
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 8576b1ddc983d74caef77c3bac51103ab26cfc8c)
CLOUDSTACK-4340: Add more debug logging

VM (id) moves from host (id) to host (id)

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit da0bb630057550cb5707a39cddb58a86a24850dd)
CLOUDSTACK-4386
XS Creating templates from volume - send the physical size in the copycommand which accordingly will populate template store ref and the usage_event tables with the right physical size
Signed off by : nitin mehta<nitin.mehta@citrix.com>
CLOUDSTACK-4294 After upgrade of CloudStack to 4.2, support old vswitch type in existing clusters if user changes the vswitch backend to another type of vSwitch

While upgrading to 4.2, the type of vswitch being used by each cluster is persisted to cluster_details table. This helps if user want to change the type of vswitch used in a zone or entire cloud later on but leave existing cluster continue to use old vswitches. Hence even after modifying the type of vswitch at cloud level (by modifying global configuration parameters) or modifying the type vswitch at zone level (by modifying the traffic label) would not disturb operation of existing clusters.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
CLOUDSTACK-4403: vmInstanceDao - initialize the SearchBuilder in init() method instead of the search dao method which wasn't thread safe, and could cause NPEs during search builder initializing.
Automation: Disable TestVMLifeCycleSharedNwVPC test suite

Rather than TestVMLifeCycleVPC.

Shared network's setup is wrong.
CLOUDSTACK-4399:[Templates] template entries are deleted from
template_store_ref when downloadTemplate times out.
Removing apache RAT plugin version spec, so that we can use version 0.10