Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

open-vm-tools won't shutdown or restart the VM #1543

Closed
gizmotronic opened this issue Jan 22, 2017 · 16 comments
Closed

open-vm-tools won't shutdown or restart the VM #1543

gizmotronic opened this issue Jan 22, 2017 · 16 comments
Assignees
Milestone

Comments

@gizmotronic
Copy link
Contributor

RancherOS Version: 0.8.0_353fa60 – local build from master as of earlier today, no customization

Where are you running RancherOS? vSphere Hypervisor 5.5u3 (ESXi) virtual machine, iPXE, diskless

open-vm-tools installs and correctly reports state to the host. However, attempting to restart the guest VM only logs a message, and doesn't actually trigger a restart. Attempting to shut down the VM results in error 3009. According to the VIX API reference, this is:

3009 – VIX_E_POWEROP_SCRIPTS_NOT_AVAILABLE
Cannot execute scripts.

This is a regression from 0.7.1, where it worked correctly.

@SvenDowideit SvenDowideit added this to the v0.8.0 milestone Jan 22, 2017
@SvenDowideit
Copy link
Contributor

@joshwget is this going to be related to the bind-mount changes?

@joshwget
Copy link
Contributor

@SvenDowideit Yes. I'll check it out.

@cloudnautique
Copy link
Contributor

@joshwget I saw this in v0.8.0-rc4 on VMWare Fusion 8.5 on my Mac. I also had issues with VMWare being able to reconcile the VM state even when shutting it down from inside the VM. Starting to use v0.8.0-rc6 today.

@gizmotronic
Copy link
Contributor Author

I got as far as discovering that the container that vmtoolsd runs in can't see /sbin/shutdown and friends, and does in fact log an error about it. I just needed to look in the right place, that is, the service container's log.

@SvenDowideit
Copy link
Contributor

useful info!

@SvenDowideit
Copy link
Contributor

this sounds like #1377

@gizmotronic
Copy link
Contributor Author

On the surface, yes. However, I'm able to suspend and resume without error.

If I run sudo system-docker logs -f open-vm-tools and then ask VMware to either shut down or reboot the guest OS, I see this:

sh: 1: /sbin/shutdown: not found

This happens for every invocation of the shutdown or reboot commands, in any order. It's worth noting that I don't get the VIX error when I do this from the ESXi console, only from the viclient (management) application.

Running a shell with sudo system-docker exec -it open-vm-tools bash gives:

root@docker-test:/# ls -ld /sbin/shutdown
ls: cannot access '/sbin/shutdown': No such file or directory

In fact, it's nowhere to be found:

root@docker-test:/# find / -name shutdown
root@docker-test:/# 

If anyone has any suggestions on where to look next, I'd be more than happy to investigate further. I haven't yet been able to piece together exactly where the open-vm-tools service is created and started.

@SvenDowideit
Copy link
Contributor

I'm part way through trying something out while I wait to see if there are any big issues found in v0.8.0-rc9

and this latest comment gives me an idea! :)

@SvenDowideit
Copy link
Contributor

@joshwget I added +ENTRYPOINT ["/usr/bin/ros", "entrypoint"] to the end of the open-vm-tools Dockerfile, and that makes the vmware shutdown button work first time - do you think that's going to be a reasonable way to progress this?

@joshwget
Copy link
Contributor

joshwget commented Feb 7, 2017

I'm pretty sure that's all that's needed. Probably better on the service file for the final fix though.

@SvenDowideit
Copy link
Contributor

@gizmotronic I've updated the service file - can you try on a new v0.8.0-rc9 vm?

@SvenDowideit
Copy link
Contributor

SvenDowideit commented Feb 7, 2017

ok, moved the entrypoint back into the Dockerfile - there's no good reason why that is working for me, and the yml file isn't but its something to look into post 0.8

@gizmotronic please test

@gizmotronic
Copy link
Contributor Author

It's now working properly. Thanks!

@benok
Copy link

benok commented Sep 20, 2017

Hi,
I'm using rancher os v1.1.0 on ESXi 6.0 3620759.

open-vm-tools seems not to work again.
Please see the output of sudo system-docker logs -f open-vm-tools below.

rancher@sd-rancher1:~$ sudo system-docker logs -f open-vm-tools
Incorrect Usage.

NAME:
   /sbin/shutdown - /sbin/shutdown RancherOS
built: '2017-08-29T23:43:58Z'

USAGE:
   shutdown [global options] [arguments...]

VERSION:
   v1.1.0

AUTHOR(S):
   Rancher Labs, Inc.

GLOBAL OPTIONS:
   -f, --force     Force immediate halt, power-off, reboot. Do not contact the init system.
   -H, --halt      halt the machine
   -P, --poweroff  halt the machine
   -r, --reboot    reboot after shutdown
   --version, -v   print the version

@gizmotronic
Copy link
Contributor Author

I can confirm that it's broken again, but suggest opening a new ticket, as this one is long since closed.

This is not related to #2074, though if this issue was fixed, that one would surface next.

@benok
Copy link

benok commented Sep 24, 2017

Thank you for your comment. I opened a new ticket #2121 .

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

No branches or pull requests

5 participants