VMWare: Recovering from running out of disk space on the Host machine

If you've ever run out of disk space you know what a pain that is. However when you run out of diskspace on the host machine running VMware, things get even more interesting.

When disk space runs out on the Host VMs are plunged into a “stuck” state, which means they cannot be restarted or started normally. Generally the best way to manage the state of the server is to:

1. Get a list of VMs:
# vmware-cmd -l

2. Check the state:

# vmware-cmd "path-to-the-vm.vmx" getstate

If this second command returns getstate() = stuck, grab a cup of coffee and know this will take a little while to fix. At this point, you’ll need to kill all the VM processes manually:

1. Find out the ids for the processes:

# ps -ef | grep vm

2. Kill the process based on the id returned:

# kill idgoeshere

Repeat for all the VMs that are stuck. This puts the VM in stopped mode. You can verify this by getting the VM state (above). To start the VM, run the following:

# vmware-cmd "path-to-the-vm.vmx" start

This should get your VM back up and running. Keep in mind this actually restarts the machine. In my experience it takes a few minutes to get the machine to respond to anything (ping, ssh, etc) and if you have any services that are not set to start on boot up you will have to do that manually.

Comments

Hi Joaguoin,

I am having same issue.

Could you please tell me how do I run this commands in windows environment.

Advance Thanks
N.Srinivas

There is no difference whether you are running Windows or any other operating systems. Joaquin's comments apply to the ESXi server itself.
If you are in Windows and need to log in, enable support mode, then use the Putty program (free and open source) to log from your Windows into the ESXi server. Those commands posted will work.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <cpp>, <java>, <php>. The supported tag styles are: <foo>, [foo].
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.

About the Author

Joaquin Lippincott, CEO

Joaquin is a 20+ year technology veteran helping to lead businesses in the move to the Cloud. He frequently speaks on panels about the future of tech ranging from IoT and Machine Learning to the latest innovation in the entertainment industry.  He has helped to modernize software for industry leaders like Sony, Daimler, Intel, the Golden Globes, Siemens Wind Power, ABC, NBC, DC Comics, Warner Brothers & the Linux Foundation.

As the CEO and Founder of Metal Toad, an AWS Advanced Consulting Partner, his primary job is to "get the right people in the room".  This one responsibility is cross-functional and includes both external business development functions as well as internal delegation and leadership development.

A UCLA alumni, he also serves in the community as a Board Member for the Los Angeles Area Chamber of Commerce, the Beverly Hills Chamber of Commerce, and Stand for Children Oregon - a public education political advocacy group. As an outspoken advocate for entry-level job creation in tech he helped found the non-profit, P4TH, an organization dedicated to increasing the number of entry-level jobs in the tech industry, and is in the process of organizing an Advisory Board for the Bixel Exchange, a Los Angeles non-profit that provides almost 200 tech internships every year.

 

Ready for transformation?