Description of problem: When running Smartstate on an SCVMM virtual machine, if a differencing disk is on a Network drive and the initial virtual disk is on a local drive, the attempt will fail with "Unable to access parent disk". Version-Release number of selected component (if applicable): How reproducible: 100% of the time. Steps to Reproduce: 1. SCVMM Virtual machine with disk on a local drive, and a parent disk. 2. Migrate the parent disk to a network drive (beginning with "\\" 3. Run Smartstate Analysis Actual results: Failed as above Expected results: Success Additional info:
When we read a virtual disk on a network drive we must used an elevated WinRM shell. Currently if the initial virtual disk read for a VM is on a local drive we assume all the parent disks in the chain are the same, which is, of course, incorrect.
https://github.com/ManageIQ/manageiq-smartstate/pull/55 fixes this issue, and should be added to both FINE and GAPRINDASHVILI.
New commit detected on ManageIQ/manageiq-smartstate/master: https://github.com/ManageIQ/manageiq-smartstate/commit/ea2d3411144e4a2868c90b9072f334e0efc6d7b9 commit ea2d3411144e4a2868c90b9072f334e0efc6d7b9 Author: Jerry Keselman <jkeselma> AuthorDate: Wed Feb 21 16:31:25 2018 -0500 Commit: Jerry Keselman <jkeselma> CommitDate: Wed Feb 21 16:31:25 2018 -0500 Check Drivetype for Each Differencing VhdxDisk When running Smartstate Analysis on SCVMM VhdxDisks first we need to determine if the virtual disk file lives on a local disk or on a network disk. Accessing the network disk must be through an elevated WinRM call, while that is not necessary for local disks. Previously once the determination is made on the initial disk opened the same type is assumed for each differencing (parent) disk in the chain of snapshots for a VhdxDisk. This, of course, may be incorrect since not each disk in the chain is necessarily on either a local or network disk. If the initial disk is local, and the parent is remote, this would cause an access error trying to read the parent disk. We are changing this to check the type of disk for each new one opened. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1547766 lib/MiqVm/miq_scvmm_vm.rb | 1 + lib/disk/modules/VhdxDisk.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
Verified on 5.10.0.18 Set up a VM with a difference disk on the local hyper-V host. The parent of the difference disk sits on a network share. Ran SSA against this VM. Confirmed non-elevated powershell commands are run when analyzing the local disk: [----] D, [2018-10-05T13:07:38.569242 #14014:b80f74] DEBUG -- : Q-task_id([job_dispatcher]) Running powershell script on hypv2012-01.ms01.cfme2.lab.eng.rdu2.redhat.com as MS01\Administrator: $file_stream = [System.IO.File]::Open("H:\diffdisk.vhdx", "Open", "Read", "Read") Confirmed elevated commands are run when analyzing the parent disk: [----] D, [2018-10-05T13:07:42.077724 #14014:b80f74] DEBUG -- : Q-task_id([job_dispatcher]) Running powershell script elevated on hypv2012-01.ms01.cfme2.lab.eng.rdu2.redhat.com as MS01\Administrator: (Get-Item "\\vmm2012-01\MS01SCVMM2012Library\VHDs\fedora-small.vhdx").length