Cleaning your vCloud Director Thumbnails (current.png)

June 15, 2013

Table of Contents

Thumbnail images are used by vCloud Director to give you a preview of the screen without opening up to the remote console, the dark side is when you migrate/svMotion a machine managed by vCloud Director, it leaves a folder along with the thumbnail, this thumbnails are created and stored by vCloud Director as current.png on the datastore in the VM’s folder.so if you are in your datastores and VMsa look or sometimes get sloopy. This PowerCLI script helps solve this, it goes through a particular datastore, and deletes all abandoned current.png files and the VM folder, this process keeps your datastores neat.

$datastore = “MyDatastore”

$viserver = “MyVIServer”

# add PowerCLI snapin

Add-PSSnapin vmware.vimautomation.core -ErrorAction:SilentlyContinue

# Connect to VI Server

Connect-VIServer $viserver

# Get the datastore we want to clean up

$dsObject = Get-Datastore $datastore

# Create a new PSDrive to that datastore

New-PSDrive -Location $dsObject -name ds -PSProvider VimDatastore -root ”

# Set location to that drive

Set-Location ds:

# From here we are going to parse through

# folders first looking for vmx files,

# if there are no vmx files,

# test for current.png and then remove the thumbnail and folder.

$dsfolders = Get-ChildItem

foreach ($dsfolder in $dsfolders)

{

    if (!(test-path “$dsfolder*.vmx”))

    {

        if (test-path “$dsfoldercurrent.png”)

        {

            remove-item “$dsfoldercurrent.png”

            if ((get-childitem .$dsfolder* | measure-object).count -lt 1)

            {

                remove-item $dsfolder

            }

        }

    }

}

Home

Share on
Facebook
Twitter
LinkedIn
Pinterest
More posts

Dedicated Servers Quick Guide

What is a Dedicated Servers? Why bother using a dedicated server over a VPS or Shared Hosting?A dedicated server is a server 100% dedicated to your website/project or business needs.

VMware vCenter Server 5.1 Update 2

There are some new features in the new VMware released some days back a vCenter Server 5.1 update 2 build 1473063. This update enables the customization for windows 8.1, windows

vCloud user training

It is clear that a lot of vCloud users are not well trained by their vCloud providers. This is due to the fact that the current training available is for

vSphere 5.1 New Storage Features

VMFS File Sharing Limits In previous versions of vSphere, the maximum number of hosts which could share a read-only file on a VMFS volume was 8. The primary use case

PowerShell your world cup

PowerShell This is something that is very exciting and if you are interested you should try it. I found the post and tried it. Here is a function and how

🎉 New Year’s Special🎉
50% OFF for Life!

🔥 DELL Bare-metal Dedicated Server in New York

🔹  Intel Gold 80 Cores
🔹  23TB SSD Flash +
🔹1TB NVMe (W RAID)
🔹 1TB DDR4 RAM 
🔹 10Gbps Redundant Uplinks 
🔹 10 IPv4 + IPv6 Addresses Included 

💲 Just $699/month – 50% OFF FOR LIFE! (Reg $1399/month)
🚀 Zero Setup Costs | Flexible OS: Ubuntu, Proxmox, ESXi, Windows, etc.

✅ Reserve Risk-Free! 30-Day Money-Back Guarantee
💡 100% Uptime Assurance – Enterprise-Grade Hardware 

🖥 Ideal for Virtualization, Data-Intensive Apps, & High Traffic Sites

Use coupon code at checkout for the discount to apply FBHEO3023EJFB
⚡ Limited Availability – Don’t Miss Out!

Get 90% Discount

First 3 People gets the Bonus!
Don't Miss Out Our Big Sale

Get 0-90% On All
247Rack Services

247Rack

The Sale Is Until The End Of March