I've got a VMware ESXi server that I connected to via SSH to run a process. (I was running "vmkfstools --punchzero myVirtualDrive.vmdk" to reclaim space on a virtual disk). The SSH client connection was disconnected when the process was only 70% complete (with several hours of estimated time remaining).
On most standard linux machines, I use "screen" to avoid SSH client disconnection issues, but since the ESXi shell is purposely a very stripped down environment, I just ran the command straight away.
Thoughts?
Enable the Secure Shell (SSH) to access the ESXi Shell remotely by using SSH. To enable or disable the Secure Shell (SSH), right-click Host in the VMware Host Client inventory. Select Services from the drop-down menu and select Secure Shell (SSH).
Even if the host is running in lockdown mode, you can still log in to the ESXi Shell if it is enabled. Enable this service to access the ESXi Shell locally.
An ESXi host is disconnected from vCenter, but VMs continue to run on the ESXi host. vCenter displays the following error when you try to create a virtual machine (VM): Virtual machine creation may fail because the agent is unable to retrieve VM creation options from the host
There are two main agents on ESXi that may need to be restarted if connectivity issues occur on the ESXi host – hostd and vpxa. hostd is a host agent responsible for managing most of the operations on an ESXi host and registering VMs, visible LUNs, and VMFS volumes. hostd is responsible for starting and stopping VMs and similar major tasks.
The command was killed when you disconnected.
What you can do to prevent this in the future is to run the command with nohup
. This will run your command in the background, continuing even when your shell "hangs up".
What I usually do when I expect a command to run long:
This way I don't have to worry about disconnects, I can just detach screen and go home after work and reattach screen the next morning to check the status of the command.
This was exactly what I was looking for, thanks all. I attempted to unmap unused block on LUNs which is vmfs 5 file system. I run this cmd esxcli storage vmfs unmap -l [LUN-NAME]
I wonder that what will happen if I close remote SSH connection while this cmd process still running.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With