VMware {code} Community
paul_xtravirt
Expert
Expert
Jump to solution

vSphere VSAN Api's - broken in 5.5?

Hi there,

Playing around in the vSphere APIs, specifically under the a Hosts config.vsanHostConfig path.

Here is some background

  • I have 3 separate environments all running vSphere 5.5 ( ESXi hosts all running VMware ESXi 5.5.0 build-1746018, vCenter's running latest build)
  • None of the environments have ever had any configuration done for vSAN
  • Environment 1 has 3 hosts
  • Environment 2 has 2 hosts
  • Environment 3 has 1 host

Looking in the MOB at the HostSystems config path

  • Hosts in Environment 1 & 2 all show an entry for vsanHostConfig of 'vsanHostConfig'
    • Clicking this entry, hostSystem (of type ManagedObjectReference) has a value of ha-host
    • Clicking this entry results in a 404 page
  • Hosts in Environment 3 show an unset value for the vsanHostConfig property under the hosts config path

Now, I would expect all hosts to have a value of unset, since no configuration has ever gone on for vSAN. Why are there mixed values?

  1. Why is there a value of ha-host in use? This is an invalid entry and doesn't follow the schema of the HostSystem type (e.g. host-123)
  2. For hosts in environment 1 and 2 it is possible to get a result of False for the Enabled property under the vsanHostConfig path. Compared to the host in environment 3, where you cannot since the propertypath is 'unset' -  this is confusing. This implies there is configuration for vsan which has not been enabled, whereas with host in environment 3 there is no configuration
  3. Environment 2 (as outlined above) is a fresh install that I did yesterday, so a complete fresh build of Windows host, vCenter server and a physical ESXi server has resulted in the problem occurring.

I believe all hosts should have their value for the vsanHostConfig object under Host\config should be unset if there is no configuration and that this is a bug in vSphere. Anyone else seen this?

Message was edited by: Paul E Davey

If you found this helpful, please consider awarding some points
Tags (4)
Reply
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Ohhhh, I just noticed you're connected to the vCenter Server MOB. OK, this makes sense now. The behavior you're seeing is expected and there's no issues with the API.

Screen Shot 2014-12-18 at 8.22.48 AM.png

ha-host property is a MoReF which basically points back to the ESXi host you've traverse and you would normally need get a "View" into that MoRef, an example using the Perl SDK:

$esxView = Vim::get_view(mo_ref => $vsanSystem->config->ha-host)

In the MOB, it's unable to perform this operation so you'll just get a blank page. The MOB is mainly to help you visualize the API, but you should not be using it for any type of programmatic access/parsing. You should be using the SDK's to do so and once you get a "View" into that object, then you'll be given back the HostSystem for the ESXi host.

View solution in original post

Reply
0 Kudos
4 Replies
lamw
Community Manager
Community Manager
Jump to solution

Hi Paul,

If you're referring to HostSystem->configManager->vsanSystem->config then this property should always be set based on the vSphere API documentation http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.host.VsanSyst...

For HostSystem->configManager->vsanSystem->config->enabled the vSphere API documentation mentions this need not be set http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.vsan.host.Con... however, I've always seen this to be the case in as you can see in the screenshot below.

Screen Shot 2014-12-17 at 5.31.39 AM.png

Regarding getting 404 on "ha-host" property, this should just link back to your HostSystem (aka ESXi host you're looking at in the vSphere MOB) https://mini/mob/?moid=ha-host I'm not sure why you're setting a 404, but when I click on the link it takes me back to what I expect. It's possible there might be an issue on the host that's causing this, however it's hard to say with what's been provided so far.

I'll ping a few folks to see if they can chime in but if you have VMware SnS, I would highly recommend you file an SR w/VMware GSS to look into this further and track it, it does seem a bit strange you're getting different results for the different hosts. I've built couple dozen VSAN environments with varying hardware both physical and virtual and have never seen this problem, so wondering if it's particular to your environment or there's something going on in these hosts causing this weirdness.

paul_xtravirt
Expert
Expert
Jump to solution

Hi William,

Thanks for the comments. FYI, I have attached a screenshot. This is from a 5.5 host that is a new build. As you can see the value for enabled is False, however, I don't see the (hostname) like in your screenshot next to the Ha-Host entry (mini.primp....).

Has your host at any point been connected to a vSan that would have caused the entry that you see?

Untitled.jpg

If you found this helpful, please consider awarding some points
Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Ohhhh, I just noticed you're connected to the vCenter Server MOB. OK, this makes sense now. The behavior you're seeing is expected and there's no issues with the API.

Screen Shot 2014-12-18 at 8.22.48 AM.png

ha-host property is a MoReF which basically points back to the ESXi host you've traverse and you would normally need get a "View" into that MoRef, an example using the Perl SDK:

$esxView = Vim::get_view(mo_ref => $vsanSystem->config->ha-host)

In the MOB, it's unable to perform this operation so you'll just get a blank page. The MOB is mainly to help you visualize the API, but you should not be using it for any type of programmatic access/parsing. You should be using the SDK's to do so and once you get a "View" into that object, then you'll be given back the HostSystem for the ESXi host.

Reply
0 Kudos
paul_xtravirt
Expert
Expert
Jump to solution

Thanks William, that actually makes sense now!

Cheers for the help.

Paul

If you found this helpful, please consider awarding some points
Reply
0 Kudos