Flings
Apps and tools built by our engineers that are intended to be played with and explored.

CloudCleaner

CloudCleaner

Summary

vCloud Director (vCD for short) relies heavily on the vCenter Servers and host machines it uses. And there may be times when you want to “uninstall” all traces of vCD from your servers and machines. CloudCleaner is a free product that helps restore these systems to a clean state. It selectively (or completely) removes all vCD-created virtual machines, resource pools, network pools, and networks. It can also unprepare hosts that have been prepared by vCD.

CloudCleaner Removes:

  • VMs (created by vCD)
  • Resource pools (created by vCD)
  • Datastore folders (created by vCD VMs)
  • Networks (created by vCD)
  • Uninstalls vCD host agents

Features:

  • Written in java, so it’s cross-platform
  • Easy-to-use UI
  • Intelligent authentication handling – if your login credentials fail, you’ll be given the chance to re-auth in realtime
  • Fast! Uses up to 2000 simultaneous threads
  • Single jar deployment – download and run
  • Auto-detects developer settings – vCenter IP and credentials
  • Safe – auto-detects inconsistencies and repairs them
  • Secured – validates vCenter server certificates and encrypts user data

System Requirements

You must have administrator access to at least one vCenter server in order to use CloudCleaner. CloudCleaner will run on any OS that has JRE (Java Runtime Environment) 5 or above.

CloudCleaner uses the following open source libraries:

Instructions

Starting CloudCleaner

Important note - make sure CloudCleaner is saved as a .JAR file (and not a .ZIP) file.

  • On Windows, double-click the cloudcleaner.jar file.
  • On other platforms, type: java -jar cloudcleaner.jar

How to Use

  1. Add vCenters you want to clean by clicking the Add vCenter button
    1. You may add as many vCenters to clean as you like
    2. Your vCenters will be scanned, and a tree of items, including host machines, will appear similar to the screenshot above
    3. At this point, no changes will be made to your vCenters
  2. CloudCleaner does its best to only scan items that are created by vCloud. However, look over the list and remove any items you don't want cleaned
    1. Do this by selecting the items you do not want cleaned, and clicking the Remove Selected button
  3. Click Start Cleaning!
    1. The app will clean all items in the list
    2. An extensive debug log will be displayed in the little gray box
    3. If you have any unexpected results, please email the debug log to me (lterheyden@vmware.com)!

Advanced

Only clean items created by vCloud Director:

  • If you uncheck this, CloudCleaner will also display VC items that are unrelated to vCloud Director. This is useful for general VC management (e.g. wiping an entire VC)
    • You will have to re-add your VCs to CloudCleaner after unchecking this

Running CloudCleaner from the command-line:

You can automatically clean a VC by running CloudCleaner from the command-line. CloudCleaner will clean a single VC and all its hosts, then exit automatically. No dialogs will be displayed; if a connection fails, the app will exit with error code -1. (Error code 0 is returned on a successful run.)

Type this at the command line for help:

    java -jar cloudcleaner.jar -help

Command-line help:

Usage: java -jar cloudcleaner.jar -vcIpAddress=10.0.0.0 -vcLogin=admin   -vcPwd=yourpwd -hostLogin=root -hostPwd=rootpwd [-skipVerify=true -scanOnly=true]

    -vcIpAddress= - the IP address of the VC to clean.
    -vcLogin= - your VC administrator username.
    -vcPwd= - your VC administrator password.
    -hostLogin= - the administrator username for your host machines.
    -hostPwd= - the administrator password for your host machines.
    -skipVerify=true - [optional] disable SSL certificate verification.
    -scanOnly=true - [optional] only scan VC, don't clean! Good for testing.

That's it! Let me know how it works for you, and if you have any feedback.

Video

Change Log

CloudCleaner:

  • New in version 3.2.1 minor but important bug fix.
  • New in version 3.2.0 - dramatic performance improvements for large vCenters, especially when run from the command-line.

Engineers

Luke Terheyden

Luke Terheyden

Cloud Management
Add Comment

18 thoughts on “CloudCleaner

  1. Loc Huynh

    I am not getting the OK or Cancel button at the “Could not validate SSL certificate ” window. Can someone help me on this? Thanks.

    Reply
  2. Jeff Jones

    Thanks for this cleaner. It worked very well. The only minor addition that may help is staggering maintenance mode for the hosts as they have the vCD agent removed.

    Reply
  3. Rajesh

    Hi, I want to migrate aroud 700 vm’s from one vcloud to another. The number is huge so vcloud connector won’t suffice. It would have been great if this cleaner tool could just remove the vcloud entires like agents etc instead of deleting the VM’s themselves. That way I could have just added the VC/hosts/datastore to the new vcloud and imported the existing VM’s without enabling customization.

    Reply
  4. Larry

    I ran the cleaner, got prompted for the credentials of my host, entered them, and got a connection failed. I then logged in with the VI client to the host with the same ROOT credentials to test access and was able to log in fine. vcCleaner just keeps prompting for host credentials when I know they are correct. Any suggestions?

    Reply
  5. Jim Owens

    I downloaded and ran the tool because I have a network pool that shows in my vcd inventory, but does not exist. I wanted to delete this network pool or maybe just the label that shows up in vcd. The only thing the cleaner shows is my 3 hosts assigned to vcd. Am I using this tool wrong?

    Reply
  6. Piet Kiekebos

    Doublecheck filelist!!! Even in vCD created mode. View replica disks and View user disks need to be removed from list. Remove all ESX hosts ecept one and run cleaner. Run for each host seperate.

    Reply
  7. RDaneel

    Certainly makes sense but it is still worth noting that if you leave your hosts in the “vCenter Items To Be Removed” pane, they will all be thrown into maintenance mode at the same time and traffic jam may ensue. Not a big deal because you can cancel the attempts for maintenance mode and you’ll just have a lot of vmotion tasks to deal with if DRS is enabled with the right amount of aggressiveness.

    Reply
    1. Luke

      Future versions of the vCD agent are requiring that the host be put into maintenance mode before uninstalling, so that’s why CC does that. I’m working on fine-tuning that feature.

      Reply
  8. Yike

    Whew … had one of those OH %$^&^% moments just now. When the status reads “Removing virtual machines” and the log states “Found virtual machine: sqldb001″ … that is panic inducing!

    Nothing was removed that wasn’t supposed to be but is sure is misleading when the status shows “removing” items and then you see all of the things you don’t want removed flying by in the log pane of the app.

    That being said, love the tool and the smoothness of it all. Takes a long time for it to run through ours since it is rather large. There is an initial scan that finds items proposed for removal … once you click START CLEANING why does it go through everything again, why not just remove the items instead of running through every object again and skipping the ones not for removal?

    Reply
    1. Luke

      Heh! The log messages are perhaps a little confusing at first, sorry about that. The scanning engine is separate from the work engine in CC, which is why there is the second scan. You can think of the first scan as “SCAN:FIND” and the second as “SCAN:REMOVE”. This makes it easy to add / modify worker engines in the future. You’re absolutely right, though, the scanner could be made smarter. I will add that to the TODO list.

      Reply
  9. Scott Bradley

    I downloaded the ZIP file and extracted.. but I don’t see a cloudcleaner.jar file anywhere in the extracted files. Where or how do I get to this file? I am really looking forward to trying this tool.

    Thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>