rbvmomi icon indicating copy to clipboard operation
rbvmomi copied to clipboard

Vsphere answers to some request with binary blobs

Open Plaristote opened this issue 11 years ago • 3 comments

Greetings !

I have a little issue with rbvmomi. It might actually come from the vsphere provider for all I know, but it turns out that some specific request, regardless of the context in which they're made, get answered with binary blobs.

I slightly modified trivial_soap.rb to output the response.body. It usually contains XML, as is expected, but when I am trying to get the config attribute of a VirtualMachine managed object, it only contains unreadable data.

These are the headers from the failing requests:

<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <RetrieveProperties xmlns="urn:vim25">
      <_this type="PropertyCollector">propertyCollector</_this>
      <specSet xsi:type="PropertyFilterSpec">
        <propSet xsi:type="PropertySpec">
          <type>VirtualMachine</type>
          <pathSet>config</pathSet>
        </propSet>
        <objectSet xsi:type="ObjectSpec">
          <obj type="VirtualMachine">vm-447</obj>
        </objectSet>
      </specSet>
    </RetrieveProperties>
  </env:Body>
</env:Envelope>

I wonder why is this happening to me ?

I also wonder if it would be a good idea to add a check after all requests to check whether the vsphere sdk answer is intact ? That would allow to raise a more explicit exception (right now it's just Nokogiri freaking out because he can't find soapenv:Body in the response).

Plaristote avatar Jul 22 '13 14:07 Plaristote

@Plaristote, What is the request you're formulating to the server?

I have not had this happen to me, but I am only using read functions in the API.

toobulkeh avatar Jul 31 '13 17:07 toobulkeh

Well I first noticed the issue when asking for VIM::VirtualMachine#config. Moments ago I just tried to use inventory_flat and inventory_tree from the VIM::Folder class, and it turns out that it also triggers the same issue.

Plaristote avatar Aug 02 '13 15:08 Plaristote

Hi

i turn into the same issue

urn:vim25/5.5 <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">env:Body<RetrieveProperties xmlns="urn:vim25"><_this type="PropertyCollector">propertyCollector</_this><specSet xsi:type="PropertyFilterSpec"><propSet xsi:type="PropertySpec">Datacenter<pathSet>name</pathSet></propSet><propSet xsi:type="PropertySpec">Folder<pathSet>name</pathSet><pathSet>parent</pathSet></propSet><propSet xsi:type="PropertySpec">VirtualMachine<pathSet>name</pathSet><pathSet>parent</pathSet><pathSet>resourcePool</pathSet><pathSet>guest.ipAddress</pathSet><pathSet>summary.config.instanceUuid</pathSet><pathSet>summary.config.numCpu</pathSet><pathSet>config.extraConfig</pathSet><pathSet>config.flags.snapshotDisabled</pathSet><pathSet>config.flags.snapshotLocked</pathSet><pathSet>config.annotation</pathSet><pathSet>config.guestFullName</pathSet><pathSet>config.flags.snapshotPowerOffBehavior</pathSet><pathSet>config.cpuAffinity</pathSet><pathSet>config.memoryAffinity</pathSet><pathSet>summary.config.memorySizeMB</pathSet><pathSet>summary.config.template</pathSet><pathSet>summary.config.memoryReservation</pathSet><pathSet>summary.config.cpuReservation</pathSet><pathSet>summary.config.numEthernetCards</pathSet><pathSet>summary.runtime.powerState</pathSet><pathSet>summary.runtime.toolsInstallerMounted</pathSet><pathSet>summary.config.uuid</pathSet><pathSet>summary.config.instanceUuid</pathSet><pathSet>summary.guest.hostName</pathSet><pathSet>runtime.powerState</pathSet><pathSet>runtime.host</pathSet></propSet><propSet xsi:type="PropertySpec">ResourcePool<pathSet>name</pathSet><pathSet>parent</pathSet></propSet><propSet xsi:type="PropertySpec">ClusterComputeResource<pathSet>name</pathSet><pathSet>parent</pathSet><pathSet>configurationEx</pathSet></propSet><objectSet xsi:type="ObjectSpec">datacenter-610<selectSet xsi:type="TraversalSpec">VisitVMsFolderVirtualMachineparent0<selectSet xsi:type="SelectionSpec">VisitFolderParents</selectSet></selectSet><selectSet xsi:type="TraversalSpec">VisitFolderParentsFolderparent0<selectSet xsi:type="SelectionSpec">VisitFolderParents</selectSet></selectSet></objectSet><objectSet xsi:type="ObjectSpec">datacenter-610<selectSet xsi:type="TraversalSpec">VisitVMsDatacentervmFolder0<selectSet xsi:type="SelectionSpec">VisitFolders</selectSet></selectSet><selectSet xsi:type="TraversalSpec">VisitFoldersFolderchildEntity0<selectSet xsi:type="SelectionSpec">VisitFolders</selectSet><selectSet xsi:type="SelectionSpec">VisitVMsResourcePools</selectSet><selectSet xsi:type="SelectionSpec">VisitResourcePoolParents</selectSet><selectSet xsi:type="SelectionSpec">VisitResourcePoolCCRs</selectSet></selectSet><selectSet xsi:type="TraversalSpec">VisitVMsResourcePoolsVirtualMachineresourcePool0<selectSet xsi:type="SelectionSpec">VisitVMsResourcePools</selectSet><selectSet xsi:type="SelectionSpec">VisitResourcePoolParents</selectSet><selectSet xsi:type="SelectionSpec">VisitResourcePoolCCRs</selectSet></selectSet><selectSet xsi:type="TraversalSpec">VisitResourcePoolParentsResourcePoolparent0<selectSet xsi:type="SelectionSpec">VisitResourcePoolParents</selectSet><selectSet xsi:type="SelectionSpec">VisitResourcePoolCCRs</selectSet></selectSet><selectSet xsi:type="TraversalSpec">VisitResourcePoolCCRsClusterComputeResourceparent0<selectSet xsi:type="SelectionSpec">VisitResourcePoolParents</selectSet><selectSet xsi:type="SelectionSpec">VisitResourcePoolCCRs</selectSet></selectSet></objectSet></specSet></RetrieveProperties>/env:Body/env:Envelope

-> return binary blob and exception

klochto avatar Jan 14 '16 11:01 klochto