Trim IQN so that the format /iqn/lun becomes iqn.(cherry picked from commit cb9fc8bece7e34c397a15a32ec1525bddd95b257)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4434: EN: Ubuntu: Direct input "- _ ", "? /", "keyboard /" ,"keyboard -" keys are not working well for the US keyboard.
Reviewed-by: Fang Wang <fang.wang@citrix.com>

Signed-off-by: Vijayendra Bhamidipati <vijayendra.bhamidipati@citrix.com>
(cherry picked from commit f2874d0f228680b0dcd3299bb070215a2648a4a8)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4405: add a tool: cloudstack-agent-upgrade to upgrade bridge name on kvm host
(cherry picked from commit 0ef6084d2c838a78eda29d258b1af98df96451b3)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4528: [Vmware] new mapping vmware datacenter cloudstack zone - Virtual Router host migration across cluster FAIL

Changes:
- listHosts within same cluster for migration of system and router VMs
(cherry picked from commit 52f4683099e03e16916dfdf741f2d5544491aaad)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4528 [Vmware] new mapping vmware datacenter cloudstack zone - Virtual Router host migration across cluster FAIL

Change:
- Also add a check in migrateSystemVM API to check that source and destination host are in the same cluster
(cherry picked from commit b24e9a6dd5281b2163ce088e6f5b1fa730c33f7d)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4539: [VMWARE] vmware.create.full.clone is set to true in upgraded setup;default nature of vms are full clone

Description:

    Do not overwrite value of vmware.create.full.clone flag in the
    cloud db if it already exists. This will preserve the configured
    clone creation behaviour across upgrades.
(cherry picked from commit a30a33c14d38a30840be19619c9aff65ed14cf2f)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4519: reimplementdestroy-volume to take consideration of on-disk snapshot
(cherry picked from commit a316ffa27f84c261cace31982aaaa9c3aaf52e6a)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4458: Volume attach/detach command needs to sent to hypervisor resource even when target VM is in Stopped state
(cherry picked from commit 995e193be2a1aad8ffe0eeb03357e23fb5c63769)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4538 Should update the vmware clusters with the global overporvisioning factors after upgrade to 4.2.
Signed off by : Nitin Mehta <nitin.mehta@citrix.com>
(cherry picked from commit 4a7d7324d0f71888365c0b8f235b30909c9cbceb)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4499: Wait until hosts are up before adding storage pools

This works around the delay caused in adding Xen 6.1/6.2 hosts where
host takes two attempts to transition to Up state. We will wait for one
minute per cluster before attempting to add storage pool in the cluster.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
(cherry picked from commit 22ee499c3571b2a6b6921abb36c679128893c415)
(cherry picked from commit dc071e963e3df9e504f951a28117f567558bb496)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4538: fix small typo
(cherry picked from commit 68b668ae8f126e339de971c99e4c29c7f86b3d6e)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4538: set default value of cpu.overprovisioning.factor and mem.overprovisioning.factor to 1

On a fresh environment, some values in cloud.configuration table are persisted in com.cloud.server.ConfigurationServerImpl.persistDefaultValues()
A default value need to be set before com.cloud.upgrade.DatabaseUpgradeChecker
(cherry picked from commit 1a67750cb66cf74175e2776ba3f3ba76fde0d1bb)
(cherry picked from commit 61ebfad4493d4f3fe4ced948985e69202080654b)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4435 [VMWARE]System VM's are failed to start with Nexus enabled Zone

Since introducing pool of session contexts we no more have a dedicated context for each VMware hypervisor host.
Hence vsm credentials stored in session context cannot be retrieved always correctly. Fix is to register the vsm credentials after fetching context and the context gets recycled after use.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
(cherry picked from commit eaea8f8c5f21257f036d4c13ba1ec50c69664a52)

Signed-off-by: animesh <animesh@apache.org>
[Upgrade from 3.0.6 to 4.2][vmware] After upgrade the system vms fail to come up because "Secondary storage mount point" is pointing to a wrong location

when secondary storage is mounted as read-only, changing permission of files on it will fail. But we should still stick to current mount point instread of
returning a wrong mount point /mnt/sec
(cherry picked from commit db2d9703c16aac0aa0ebcadaa75022981fbfe6cc)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-1192: GetVmDiskStatsCommand return null as disk I/O statistics does not support xen/vmware
(cherry picked from commit 3121133c03c4db30c9bc0a3a5546e19678b2ee76)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4459: fix silly bug, one more time
(cherry picked from commit 93bfe708d9cc4da6a7bec3ecaaa17812b2b73048)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4561: DeployVm failed after upgrading from earlier version having a private zone to 4.2

Changes:
- In the upgrade path, for a private zone, entry needs to be added in the affinity_group_domain_map to provide access to the private zone for the domains it belongs too.
(cherry picked from commit 0b9b36cbca0a4294ccdb3f68ababefc314d9fd8e)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4539: [VMWARE] vmware.create.full.clone is set to true in upgraded setup;default nature of vms are full clone
Reviwed-by: Kelven Yang <kelven.yang@citrix.com>
Description:

    Change the criterion for overriding/preserving the vmware.create.full.clone
    flag. The earlier criterion was simply the version numbers, but that is not
    a good business logic basis for the change. With this fix, if past version
    deployments have any deployments (data centers), this flag will be set to
    false. Else, it will be set to true.
(cherry picked from commit 07d79c7ad660375cfb0e88794048993c4e349cf0)

Signed-off-by: animesh <animesh@apache.org>
Fix the build cause by typo in a un-test check-in!
(cherry picked from commit 2848af8126f47f92ebb90191e62778461193cb9b)

Signed-off-by: animesh <animesh@apache.org>
CLOUDSTACK-4405: fix vm migration during the upgrade to 4.2
(cherry picked from commit 3cca6502a1b48556ca7bb103ed226d44557dc399)

Signed-off-by: animesh <animesh@apache.org>