Skip to content

[BUG] ScsiLun.AlternateName data in vcsim is too large for a signed byte #3615

@ninjarobot

Description

@ninjarobot

The ScsiLun alternate name in newer releases (v0.38.0 and newer) of vcsim contains data that doesn't meet the signed byte size. Here is an example of the data:

<alternateName>
    <namespace>GENERIC_VPD</namespace>
    <namespaceId>5</namespaceId>
    <data>0</data>
    <data>0</data>
    <data>0</data>
    <data>4</data>
    <data>0</data>
    <data>176</data>
    <data>177</data>
    <data>178</data>
</alternateName>

Per the vSphere API, this should be an array of xsd:byte:
image

An xsd:byte is called a byte, but it is actually a signed byte - between -128 and 127 per the XSD spec.

To Reproduce
Steps to reproduce the behavior:

  1. Launch vcsim using docker on any tag v0.38.0 or newer: docker run --rm -it -p 8989:8989 vmware/vcsim:v0.38.0
  2. Execute the WaitForUpdatesEx SOAP API, as this will return all the inventory, including this malformed data.
  3. Inspect the SOAP response, looking for alternateName where you'll see the <data> fields that contain values that overflow the xsd:byte range.

Expected behavior
The <data> fields in the alternateName should fit within the signed byte range of -128 to 127, like this (behavior from v0.37.3):

<alternateName>
    <namespace>GENERIC_VPD</namespace>
    <namespaceId>5</namespaceId>
    <data>-79</data>
</alternateName>

Affected version
vcsim:v0.38.0 up until latest v0.46.0

Additional context
This worked correctly in older versions of vcsim, up until running with docker using this tag: vmware/vcsim:v0.38.0, and I suspect this is related to the fix for #3469.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions