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: devices stay connected when vm is powered off #2797

Closed
Syuparn opened this issue Mar 27, 2022 · 0 comments · Fixed by #2798
Closed

[BUG] vcsim: devices stay connected when vm is powered off #2797

Syuparn opened this issue Mar 27, 2022 · 0 comments · Fixed by #2798

Comments

@Syuparn
Copy link
Contributor

Syuparn commented Mar 27, 2022

Describe the bug

When vm is powered off, its devices remain to be connected. They should be disconnected.

To Reproduce
Steps to reproduce the behavior:

  1. run vcsim
  2. connect a device on a powered on vm
  3. power off the vm
$ vcsim &
$ govc vm.info DC0_H0_VM0 | grep Power
  Power state:  poweredOn

# connect ethernet-0
$ govc device.connect -vm DC0_H0_VM0 ethernet-0
$ govc device.info -vm DC0_H0_VM0 ethernet-0 | grep onnected
  Connected:        true
  Start connected:  true

# power off vm
$ govc vm.power -off DC0_H0_VM0
Powering off VirtualMachine:vm-54... OK

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

Device ethernet-0 is disconnected.

$ govc device.info -vm DC0_H0_VM0 ethernet-0 | grep onnected
  Connected:        false
  Start connected:  true

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

  • vcsim v0.27.4

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

Device ethernet-0 is still connected.

$ govc device.info -vm DC0_H0_VM0 ethernet-0 | grep onnected
  Connected:        true
  Start connected:  true

Additional context
Add any other context about the problem here.

  • devices on suspended vm should also be disconnected
# real vCenter
$ govc device.info -vm myvm ethernet-1 | grep onnected
  Connected:        true
  Start connected:  true
$ govc vm.power -suspend myvm
Suspend VirtualMachine:vm-15... OK
$ govc device.info -vm myvm ethernet-1 | grep onnected
  Connected:        false
  Start connected:  true
  • devices on powered off vm should not be connected
$ govc device.info -vm myvm ethernet-1 | grep onnected
  Connected:        false
  Start connected:  true
$ govc device.connect -vm myvm ethernet-1
$ govc device.info -vm myvm ethernet-1 | grep onnected
  Connected:        false
  Start connected:  true
  • devices on powered off vm should be connected by vm power-on if Start connected is true
$ govc device.info -vm myvm ethernet-1 | grep onnected
  Connected:        false
  Start connected:  true
$ govc vm.power -on myvm
Powering on VirtualMachine:vm-15... OK
$ govc device.info -vm myvm ethernet-1 | grep onnected
  Connected:        true
  Start connected:  true
Syuparn added a commit to Syuparn/govmomi that referenced this issue Mar 27, 2022
Closes: vmware#2797
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
Syuparn added a commit to Syuparn/govmomi that referenced this issue Apr 1, 2022
Closes: vmware#2797
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