87 Commits

Author SHA1 Message Date
Abhinandan Prateek
4627fb2cd7 CLOUDSTACK-9972: Enhance listVolume API to include physical size and … (#2158)
* CLOUDSTACK-9972: Enhance listVolume API to include physical size and utilization.
Also fixed pool, cluster and pod info

* CLOUDSTACK-9972: Fix volume_view and duplicate API constant

* CLOUDSTACK-9972: Backport Do not allow vms to be deployed on hosts that are in disabled pod

* CLOUDSTACK-9972: Fix localization missing keys

* CLOUDSTACK-9972: Fix sql path
2017-11-05 21:44:43 +05:30
vedulasantosh
48fa20698e CLOUDSTACK-9963 Root Disk controller value is changing while migrating VM 2017-09-11 16:19:10 +05:30
Jayapal
e3ae08b3ee CLOUDSTACK-9709: Updated the vm ip fetch task to use the correct the thread 2017-03-07 09:50:18 +05:30
Sateesh Chodapuneedi
b0535d770d CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots
Issue
====
Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM.
Per the code that detects the presence of a snapshot, we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree.
The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM.
This results in start failure.

Fix
===
Ensure correct detection of VM snapshots in the VM snapshot tree

This closes #1828

Signed-off-by: Sateesh Chodapuneedi <sateesh.chodapuneedi@accelerite.com>
(cherry picked from commit 673bb25b5936d1c54e9210781280e9ddc507c830)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-22 13:29:07 +05:30
Rohit Yadav
8e4644e413 vmware: improve support for disks
- Improve disk chain usage while attaching, migrating disks
- Gets root disk controller based diskDeviceBusName from volume's chain info
- Refactor and move VirtualMachineDiskInfo to cloud-utils
- Allows mixing of scsi controller types
- Fixes a NPE case with map passed as null, for example in case of detach volume
  command
- Use a osdefault translator that allow use of recent os types added (enums of
  which) are not available in the sdk

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-04-18 22:44:18 +05:30
Sateesh Chodapuneedi
6a9956e0f5 CLOUDSTACK-4787 Allow selection of scsi controller type in vSphere
commit #7
    So far only 1 controller (scsi or ide) is supported in Cloudstack for ide or
    scsi, this is existing limitation. Added support for 2nd IDE controller. Support adding IDE
    virtual disk to VM. Also added check if VM is running as IDE virtual disk cannot be attached
    to VM if VM is runnning.If user detaches a virtual disk on lower unit number of controller,
    then subsequent attach operation should find free unit number on the controller and attach
    the virtual disk there.

    commit #6
    Let the controllers of existing VMs continue without flip, current busInfo retrieved from
    chain_info field of volume record from database would be preferred over
    controller settings from all configuration settings.

    commit #5
    Editing global configuration param vmware.root.disk.controller osdefault value results
    in loss of previous root disk controller type. Hence root disk's controller type for legacy
    VMs is unknow post that modificaiton by user. If VM is stop/start then we could get this
    infromation from bus info of existing volume. But if user resets VM and then try to start VM.
    The existing bus info would be lost. Hence existing disk info is not available to depend on.
    Using lsilogic or generic scsi controller for ROOT disk of legacy VMs if reset.

    commit #4
    Avoid adding additional (>1) scsi controllers to system vms. While attaching volume to legacy VM
    don't use osdefault optoin which applicable only for VM created with the option enabled, use
    legacy data disk controller type (lsilogic)

    commit #3
    If root disk's controller type is scsi and data disk controller type condenses
    to any of scsi sub-types then data disk controller type would fall back to root disk controller itself. This
    ensures data volumes would be accessible in all cases as controller of root volume would be reliable
    and it means VM has the supported controller. It also avoids mix of scsi controller sub-types in a user instance.
    Also translating disk controller type scsi to lsilogic.

    commit #2
    Support auto detection of recommended virtual disk controller type for specific guest OS.

    commit #1
    Support granual controller types. Add support for controller types in template registration as well.

    Fix white spaces.
    Removed stale HEAD merge lines
    Removed tail of merge lines
    Fixed VmwareResource, removing storage commands that moved to VmwareStorageProcessor.
    removed stale code of controller that is present in processor
    Fixed check style errors.
    Fixed injection.
    Tested with Linux and windows templates. Unable to run iso based tests due to few bugs in register iso area.

    Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

(cherry picked from commit a4cc987a6f66f20c434942956fffe5951df09e43)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-11-27 18:39:41 +05:30
Likitha Shetty
cb50d1d827 CLOUDSTACK-8610. Unable to attach 7th Disk to Windows Server 2012 R2 instance. During disk attach, while trying to obtain the controller key for SCSI controller, look for device with the generic SCSI controller type i.e. VirtualSCSIController.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #554
2015-08-26 15:14:24 +05:30
Daan Hoogland
e2b6237464 CLOUDSTACK-8656: debug messages on interupted exceptions 2015-07-30 16:03:10 +02:00
Likitha Shetty
f5ed824ea2 CLOUDSTACK-8598. CS reports volume migration as successful but the volume is not migrated in vCenter.. For the following disk operations - migration, snapshot creation, resize, detach and template creation, CS should do an exact disk match between volume path and vCenter disk name. If the exact matching fails to find a disk, CS should fall back to the old method of partial matching on a trimmed disk.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #543
2015-07-16 10:44:58 +02:00
Rafael da Fonseca
00cdd66351 Fix 3 findbugs warnings OVF and VMX descriptor files should be written in UTF-8
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #404
2015-06-15 12:05:08 +03:00
Rohit Yadav
04dccda3f0 vmware-base: get vsessiontimeout from client class
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 4d9a94ce6956e61882b0fd7f15c1ec66d6419135)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-13 15:48:11 +05:30
Likitha Shetty
bdd28a45ed CLOUDSTACK-8319. For both 'MigrateVolume' and 'MigrateVMWithVolumes, ensure VM's vconfiguration files are migrated along with VM's root volume. 2015-03-12 11:57:02 +05:30
Likitha Shetty
974b0180dd CLOUDSTACK-8126. Cold Migration of VM is not working as expected. In case a VM is cold migrated across clusters then VM fails to start.
1. If a VM by the same name exists on a different cluster in the VMware DC, unregister the existing VM and continue with the VM start.
2. If VM start succeeds, delete VM files associated with the unregistered VM.
3. If VM start fails, re-register the unregistered VM.
2014-12-24 15:07:08 +05:30
Likitha Shetty
ac491c9607 CLOUDSTACK-8121. Data disk properties are not updated upon Creation/Deletion of VM snapshots.
Update the path and size of data volumes after snapshot creation/deletion by correctly trimming only the snapshot postfix of a disk.
2014-12-24 13:04:12 +05:30
Likitha Shetty
b1bca2a2c0 CLOUDSTACK-8119. [VMware] Cannot attach more than 8 volumes to a VM. 2014-12-24 11:36:27 +05:30
Likitha Shetty
4d7ede535d CLOUDSTACK-8119. Propagate error message to UI for attach/detach volume failure operations.
For AttachVolume/DetachVolume API command, improve user error message in case of RuntimeException by throwing the exception instead of 'Unexpected Exception'.
2014-12-24 11:29:03 +05:30
Likitha Shetty
f420dd55fb CLOUDSTACK-8119. [VMware] Cannot attach more than 8 volumes to a VM.
While attaching a new disk to an instance, the unit number on the controller key should be the lowest unit number
that is not in use. And in case the controller type is SCSI it shouln't be the reserved SCSI unit number.
2014-12-24 10:48:03 +05:30
Likitha Shetty
ddcae8a930 CLOUDSTACK-8118. Root volume migration fails with 'No such disk device' in case of vCenter 5.5 setup.
If an exact match is being done while locating disk chain by name, don't trim snapshot postfix appended to the disk name.
2014-12-24 10:19:22 +05:30
Likitha Shetty
cb211f18d1 CLOUDSTACK-8113. VM migration fails with "Message: No such disk device: " error.
Consolidate VM disks once VM/volumes are migrated.
2014-12-23 14:28:17 +05:30
Likitha Shetty
b41a78ce0f CLOUDSTACK-7248. [VMware] Extract volume fails with an NPE.
Synchronize attach disk to VM on the VM object value instead of using a DB lock.
2014-08-08 15:31:03 +05:30
Likitha Shetty
bb7fc59947 Revert "CLOUDSTACK-7077. Quickly attaching multiple data disks to a VM fails."
This reverts commit a9b3ab089d6cb0bc1494e10b2be90292f4c79289.
2014-08-08 15:31:03 +05:30
Sateesh Chodapuneedi
dfa607fb44 CLOUDSTACK-7250 [vCenter 5.5] SourceNAT,StaticNAT and Portfowrding is not working with Vmware DVS in vCenter 5.5
Change in vCenter 5.5 API from prior versions forced code change in CloudStack. Update property value of property "VirtualE1000.deviceInfo.summary" is accommodated now.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
2014-08-05 10:00:00 +05:30
Kelven Yang
bfb28da9fc Trim postfix appended to the disk name by vCenter after snapshot operation when we are locating disk chain by name 2014-07-11 14:42:46 -07:00
Likitha Shetty
a9b3ab089d CLOUDSTACK-7077. Quickly attaching multiple data disks to a VM fails.
[VMware] Synchronize the tasks of disk preparation and reconfiguration of a VM with the disk.
This is to avoid attaching a disk with a wrong device number on the controller key.
2014-07-08 13:24:13 +05:30
Likitha Shetty
4be369c94c CLOUDSTACK-7072. Volume attachment fails with 'A specified parameter was not correct' error.
[VMware] While attaching a new disk to an instance, the unit number on the controller key should be the lowest unit number on the key that is not in use.
Instead of a number that is 1 digit higher the highest unit number that is currently in use.
2014-07-07 17:40:06 +05:30
Kelven Yang
9f0d1cee64 Make sure to let VM question answer monitor exit gracefully 2014-02-28 15:35:58 -08:00
Kelven Yang
6987f23380 Pragrammatically Answer HA question posted in vCenter since it will block CloudStack from continuously operating on the VM 2014-02-28 15:35:58 -08:00
Kelven Yang
e051490cea Make sure to let VM question answer monitor exit gracefully 2014-02-28 15:35:58 -08:00
Kelven Yang
4a414d3990 Pragrammatically Answer HA question posted in vCenter since it will block CloudStack from continuously operating on the VM 2014-02-28 15:35:58 -08:00
Likitha Shetty
0926bf57f4 CLOUDSTACK-6146. [VMware] [ESXi 5.5] Live storage migration of an already migrated volume fails
In vCenter 5.5, once a volume is migrated the VMDKs are renamed to match the name of the VM.
If a volume has been renamed upon migration update its volumePath to that of the new disk filename.

Conflicts:

	plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
	vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
2014-02-26 13:45:43 +05:30
Nitin Mehta
c969aa2595 CLOUDSTACK-6134:
If volume already exists for the vm - register the vm in the inventory and start it.
2014-02-18 18:24:33 -08:00
Hugo Trippaers
b20add810e Get rid of compiler warnings in vmware-base 2014-01-22 09:37:34 +01:00
Sateesh Chodapuneedi
db99146187 CLOUDSTACK-5661 [VMware] DetachIsoCmd succeeds even though cdrom is locked by VM as cdrom is mounted
DetachISO is succeeding even though detach opeartion is failing as cdrom is locked by VM as it was mounted inside VM.
Detect if cdrom is locked or not. If locked fail detach operation and warn user to unmount before detaching the iso/cdrom device.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>

Conflicts:

	plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
	plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
	vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
2013-12-28 02:36:53 +05:30
Likitha Shetty
fa2f18d2a2 CLOUDSTACK-4875. Vmware vCenter 5.5 - System VM deployment fails During VM deployment.
When base template is being cloned to create VM ROOT disk, get the disk path i.e. base file name
of the VM's ROOT disk from vCenter
2013-12-17 18:31:15 +05:30
Alex Huang
be5e5cc641 All Checkstyle problems corrected 2013-12-12 12:26:07 -08:00
Alex Huang
d620df2bdd Reformatted all of the code. 2013-11-21 06:15:26 -08:00
Alex Huang
e4b22d0fca Replace all tabs, particularly the ones in the comments 2013-11-21 03:39:58 -08:00
Alex Huang
8d62744681 Reformat all source code. Added checkstyle to check the source code 2013-11-20 07:26:53 -08:00
Kelven Yang
fc9adec72e CLOUDSTACK-669: Add host level side-by-side VM state report for graceful sync model migration 2013-11-12 18:32:51 -08:00
Sateesh Chodapuneedi
a70bbdb139 CLOUDSTACK-4993 [VMware] When issuing detach ISO to Vcenter, MS should prevent Vcenter from posting Virtual Machine question dialog waiting for user response
During ISO detach operation, answer question from vCenter by programmatically answering for VM question in detaching process.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
2013-11-11 09:11:54 +05:30
Mike Tutkowski
449b5daa70 VMware changes related to managed storage 2013-10-31 08:30:50 -06:00
Kelven Yang
16b022b1b1 CLOUDSTACK-4802: Change VM start flow to better support VM snapshot on certian version of vSphere, (vSphere 5.0 Update 2). If we detect that VM has pending VM snapshot, we will fully honor VM disk info from vCenter, since in some version of vSphere (vSphere 5.0 U2) does not allow disk-editting when VM has pending snapshot. 2013-10-04 16:13:56 -07:00
Kelven Yang
a3babdd61c CLOUDSTACK-4790: Skip reserved VMware scsi device number for SCSI disks 2013-10-02 17:53:56 -07:00
Kelven Yang
1598571dfc CLOUDSTACK-4659: Fix the regression caused by worker VM consolidation for GC purpose 2013-09-17 14:07:14 -07:00
Kelven Yang
5820b071b8 CLOUDSTACK-4659: Add the missing feature back for GC VMware worker VMs 2013-09-17 14:06:52 -07:00
Kelven Yang
ae231444bc CLOUDSTACK-4585: make run-time datastore folder migration, VM snapshot, bug in root disk controller type carried from previous version work under upgrade situation 2013-09-04 14:49:46 -07:00
Kelven Yang
281b94d587 CLOUDSTACK-4458: Volume attach/detach command needs to sent to hypervisor resource even when target VM is in Stopped state 2013-09-04 14:49:46 -07:00
Kelven Yang
ea13e089b8 CLOUDSTACK-4519: reimplementdestroy-volume to take consideration of on-disk snapshot 2013-09-04 14:49:46 -07:00
Kelven Yang
bae2666549 CLOUDSTACK-3237: add disk chain sync logic to handle out-of-band chain changes that could happen in storage live migration and VM snapshot operations 2013-09-04 14:49:46 -07:00
Kelven Yang
e3a5b3fad9 CLOUDSTACK-3237: acknowledge the behind-back VMDK disk consolidation happend in vCenter after storage live migration 2013-09-04 14:49:46 -07:00