Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Govmomi v0.38.0, Neither task.WaitForResult nor task.WaitForResultEx work for me while trying to Power Off/On or Register VM on a standalone ESXI #3649

Open
bharadwaj-reddy-22 opened this issue Dec 11, 2024 Discussed in #3648 · 1 comment

Comments

@bharadwaj-reddy-22
Copy link

Discussed in #3648

Originally posted by bharadwaj-reddy-22 December 11, 2024
My code snippets.
This error is related to
vm is a object.VirtualMachine that I get through SOAP request to ESXI Host.
v is a VMwareClient which has govmomi.GovInterface which I use to make Govmomi SOAP requests.
off, err := vm.PowerOff(v.ctx) if err != nil { return err } return v.TaskWaitForResult(v.ctx, off)

when I use taskInfo, err := task.WaitForResultEx(ctx) in TaskWaitForResult method I see that the task is completed from the UI of ESXI host but the WaitForResultEx keeps waiting for a response to this request

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Body><WaitForUpdatesEx xmlns="urn:vim25"><_this type="PropertyCollector">ha-property-collector</_this></WaitForUpdatesEx></Body></Envelope> for 10 mins.

My assumption is the task gets completed before the SOAP request for WaitForUpdateEx lands on the host and as task is completed no updates are returned and the method keeps waiting.

when I use taskInfo, err := task.WaitForResult(ctx) in TaskWaitForResult method I see that it creates a new PropertyCollector but while creating a filter for the property collector it is not able to find the property collector created as part of task.WaitForResult and gives the following error:

<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring>The object &apos;vmodl.query.PropertyCollector:session[523d1a0a-9c22-8da5-c65c-127085550672]52bb34e0-1c4d-55ad-9269-593bab656a07&apos; has already been deleted or has not been completely created</faultstring><detail><ManagedObjectNotFoundFault xmlns="urn:vim25" xsi:type="ManagedObjectNotFound"><obj type="PropertyCollector">session[523d1a0a-9c22-8da5-c65c-127085550672]52bb34e0-1c4d-55ad-9269-593bab656a07</obj></ManagedObjectNotFoundFault></detail></soapenv:Fault> </soapenv:Body> </soapenv:Envelope>

Please help me understand what should I do to solve these issues?

Copy link
Contributor

Howdy 🖐   bharadwaj-reddy-22 ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant