Description of problem: Standard method in /RedHat/Integration/VMware has several reproducible bugs. Version-Release number of selected component (if applicable): 5.5.0.13.20151201120956_653c0d4 How reproducible: 100% Steps to Reproduce: 1. Create a copy of /RedHat/Integration/VMware/VimApi/VMware_HotAdd_Disk to custom name space 2. Create a button to be used for a VM 3. Create a service dialog that asks for the disk size ("size") 4. Try to use the button to add a disk. Actual results: 1. Nothing happens. Action ends with "addDisk: no SCSI controller found" in the vim.log after raising log level to debug. Reason: wrong pattern matching in the script, at least, for a VMware vCenter talking german language. I suspect, it's SCSI-Controller (SCSI-dash-Controller) in german language. See #1130060, explained that there. If it's a national language setting, I'd suggest to normalize all API calls to one language in general. 2. Disk is added, but as independent-persistent. In /var/www/miq/vmdb/gems/pending/VMwareWebService/MiqVimVm.rb the method addDisk removes all keys in the options hash that have no value. While they should have a value of "true", they vanish on the way, the addDisk method just sees "nil" values and therefore removes the keys. Expected results: Disk is added with the parameters specified in the method. Additional info:
See additional comments here https://bugzilla.redhat.com/show_bug.cgi?id=1130060#c3
Milan, can you figure out if test automation missed this please.
This ticket is reporting two different issues: 1. The add_disk logic does not work which this ticket suggests could be related to a regex parsing issue. We will address that issue using this ticket. 2. The enhancement to pass along additional values as part of the add_disk method. This is an enhancement because the code currently only passes disk_name and disk_size as part of the call. https://github.com/ManageIQ/manageiq/blob/master/lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-vmware-infra_manager-vm.rb#L11 I am re-opening bug 1130060 (mentioned in description and comment #2) to address this enhancement.
Hi Martin, We've been looking into this issue and have a question. Per - https://bugzilla.redhat.com/show_bug.cgi?id=1130060#c3 - Is there anyway you could get a screen shot of the hardware edit screen showing the SCSI controller label - 'SCSI-Controller'? We're looking at making the change to allow a '-' in the regex - but we've been unable to find a version of the label that includes a '-'. We wanted to make sure that we're not missing additional characters in the label with a specific regex change - while not opening the regex too much with a .* change. Thanks so much! ~Drew
Drew, I just logged on to the customer environment, but only to their development environment. They moved to the vCenter appliance version 6.0 now, and in the vSphere Web (!) Client, I see things totally different. It says SCSI Adapters -> SCSI controller 0 (LSI Logic SAS), for example, when I edit the hardware of a VM. I debugged /var/www/miq/vmdb/gems/pending/VMwareWebService/MiqVimVm.rb on-site, added some debug output, and it was clearly visible, that we got "SCSI-Controller" back from the vCenter API: in getScsiCandU, I logged the output of the label value in this block: def getScsiCandU devs = getProp("config.hardware")["config"]["hardware"]["device"] ctrlrHash = {} devs.each do |dev| next unless (key = dev["key"]) next unless dev["deviceInfo"] next unless (label = dev["deviceInfo"]["label"]) ctrlrHash[key] = 0 if label =~ /^SCSI\s[Cc]ontroller\s.*$/ end The value of label was definitely "SCSI-Controller", and in the native Windows vCenter client it is shown as that, but I cannot provide that information right now, the responsible person is on a training this week. I patched the regex to ^SCSI[\s-][Cc]ontroller\s.*$ to see if I run into other issues: ^SCSI-[Cc]ontroller\s.*$ - that works, but of course, this breaks the original format. Personal comment: I think we shouldn't rely on a format of a probably-localized string. Isn't there some numeric value that we can match against? Or, can we at least enforce one definitive language while talking to the vCenter, before we run into similar troubles with other localizations? I found https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2121646, it seems there is functionality to set a particular language when opening a session through the API. Regards, Martin
https://github.com/ManageIQ/manageiq/pull/7554
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/73a521788e2cd3ffa46a561c6f41f794e3267446 commit 73a521788e2cd3ffa46a561c6f41f794e3267446 Author: Drew Bomhof <dbomhof> AuthorDate: Mon Mar 28 16:39:33 2016 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Tue Apr 12 11:44:00 2016 -0400 Check for a specific xsiType when adding a disk to a VMware instance https://bugzilla.redhat.com/show_bug.cgi?id=1311221 When hot adding a disk we were using a Regex to find the appropriate SCSI controller. This change validates the xsiType as being the correct type and removes the Regex. This will remove the problems the Regex created with different localizations. gems/pending/VMwareWebService/MiqVimVm.rb | 36 +++++++-------- .../pending/spec/VMwareWebService/MiqVimVm_spec.rb | 52 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 19 deletions(-)
Checked in 5.6.0.2-beta2. I had to change the size to dialog_size in the vmware automate method. With the latest ESX compatibility version of the tempalte I was able to successfully hot add the disk using the automate method.
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=c6f003e637fd747b7739b68840e1088ff4471842 commit c6f003e637fd747b7739b68840e1088ff4471842 Author: Drew Bomhof <dbomhof> AuthorDate: Mon Mar 28 16:39:33 2016 -0400 Commit: Drew Bomhof <dbomhof> CommitDate: Mon May 2 16:33:59 2016 -0400 Check for a specific xsiType when adding a disk to a VMware instance https://bugzilla.redhat.com/show_bug.cgi?id=1311221 When hot adding a disk we were using a Regex to find the appropriate SCSI controller. This change validates the xsiType as being the correct type and removes the Regex. This will remove the problems the Regex created with different localizations. gems/pending/VMwareWebService/MiqVimVm.rb | 36 +++++++-------- .../pending/spec/VMwareWebService/MiqVimVm_spec.rb | 52 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 19 deletions(-)
New commit detected on cfme/5.5.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=31bc75c2e68161cec88904ed9c3f38a98e21a452 commit 31bc75c2e68161cec88904ed9c3f38a98e21a452 Merge: fa34055 c6f003e Author: Greg McCullough <gmccullo> AuthorDate: Tue May 24 11:14:17 2016 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Tue May 24 11:14:17 2016 -0400 Merge branch 'add_vmware_hotdisk_5.5.z' into '5.5.z' Check for a specific xsiType when adding a disk to a VMware instance https://bugzilla.redhat.com/show_bug.cgi?id=1311221 When hot adding a disk we were using a Regex to find the appropriate SCSI controller. This change validates the xsiType as being the correct type and removes the Regex. This will remove the problems the Regex created with different localizations. PR: https://github.com/ManageIQ/manageiq/pull/7554 Cherry Pick was clean See merge request !923 gems/pending/VMwareWebService/MiqVimVm.rb | 36 +++++++-------- .../pending/spec/VMwareWebService/MiqVimVm_spec.rb | 52 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 19 deletions(-)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1348