Wrong error message in add host process:
Open
Nobody has claimed this yet.
needs verification
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 763
- PR merge metrics
- No merged PRs in 30d
Description
Steps:
- Have an old datacenter with hostname = 'host_yyy' and IP = 'xxx.xxx.xxx.xxx'
- Try to add a host to a new datacenter in Vcenter, with hostname = 'host_xxx' and IP = 'xxx.xxx.xxx.xxx'
This is how we call addHost:
connectSPEC = vim.host.ConnectSpec(hostName='host_xxx', password=password, userName=userName,
sslThumbprint=sslThumbprint)
t = self.datacenter.hostFolder.childEntity[0].AddHost_Task(spec=connectSPEC, asConnected=True)
assert task.info.state != vim.TaskInfo.State.error
We get the error:
ERROR root task ClusterComputeResource.addHost completed with state error and error (vim.fault.DuplicateName) {
dynamicType = <unset>,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = "The name 'host_yyy' already exists.",
faultCause = <unset>,
faultMessage = (vmodl.LocalizableMessage) [],
name = 'host_yyy',
object = 'vim.HostSystem:host-1234'
}
The error doesn't reflect an IP collision, but a name collision.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied AddHost_Task call and inspect how pyvmomi exposes the returned vim.fault.DuplicateName details. Reproduce the old-datacenter and new-datacenter setup, then determine whether the misleading hostname message originates in pyvmomi or vSphere. Done means identifying the responsible layer and correcting or documenting the reported collision information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100