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

[BUG] vcsim: -method-delay does not work #3323

Closed
Syuparn opened this issue Jan 4, 2024 · 0 comments · Fixed by #3324
Closed

[BUG] vcsim: -method-delay does not work #3323

Syuparn opened this issue Jan 4, 2024 · 0 comments · Fixed by #3324

Comments

@Syuparn
Copy link
Contributor

Syuparn commented Jan 4, 2024

Describe the bug
vcsim option -method-delay does not work and created tasks are completed immediately.

To Reproduce
Steps to reproduce the behavior:

  1. run vcsim: vcsim -method-delay "PowerOff:10000"
  2. create a new task: govc vm.power -off -force DC0_H0_VM0
  3. get current tasks: govc tasks | grep PowerOff

Expected behavior
A clear and concise description of what you expected to happen.

There is a running PowerOff task.

$ govc tasks | grep PowerOff
PowerOff                                 vm-55                          vcsim                           11:41:11  running

Affected version
Please provide details on the version used, e.g. release tag, commit, module version, etc.

  • vcsim 0.34.1

Screenshots/Debug Output
If applicable, add screenshots or debug output to help explain your problem.

PowerOff task succeeds instantly.

$ govc tasks | grep PowerOff
PowerOff                                 vm-55                          vcsim                           11:41:11  11:41:11  11:41:11 success [654.214µs]

Additional context
When the task PowerOffVM_Task is delayed instead of PowerOff, it will wait as specified by -method-delay. However the task will not appear until it has completed.

# delay PowerOffVM_Task for 10 seconds
$ vcsim -method-delay "PowerOffVM_Task:10000"
# This takes 10 seconds to get response
$ govc vm.power -off -force DC0_H0_VM0
Powering off VirtualMachine:vm-55... OK

$ govc tasks | grep PowerOff
# 10 seconds later
$ govc tasks | grep PowerOff
PowerOff                                 vm-55                          vcsim                           11:44:56  11:44:56  11:44:56 success [811.876µs]
Syuparn added a commit to Syuparn/govmomi that referenced this issue Jan 4, 2024
Closes: vmware#3323
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
dougm pushed a commit that referenced this issue Jan 8, 2024
Closes: #3323
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
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

Successfully merging a pull request may close this issue.

1 participant