Check orphaned vmdk files are not used before deleting

Hi all

I'm working on a site and after looking through the vSphere platform, it came to light that there are THOUSANDS (well more than 10,000) of orphaned VMDK files, it seems that there is a bug in the backup solution (you think).

In any case I was hoping someone could help me please do you know if there is a way to confirm that a vmdk is certainly not necessary, the tools I've used to identify the orphaned VMDK are the script here practically Jason: orphaned VMDK files and RV tools (health tab).

What I need to do now is to automate the removal of the VMDK if possible, but I need to run a test of consistency first to ensure that the files are actually orphans.

Any help or advice greatly appreciated.

Hello

I can give you only a few rough concepts and advice because I do not know the details.

First, he yells for PowerCLI, below, you will get a few commands. If you are not familiar with PowerCLI/Powershell I highly recommend to get a grip on it.

Second, I'll assume that orphaned files = unused files. If this isn't the case, you can rename/move file instead of delete and wait as these phone calls / tickets

Thirdly, since we will work on files on data warehouses, we will use "vmstores" PSDrive. Get-PSdrive cmdlet will give you all the readers, that you, one of them is vmstores

C:\Windows\system32> Get-PSDrive

Name           Used (GB)     Free (GB) Provider      Root                                                                                                                   CurrentLocation
----           ---------     --------- --------      ----                                                                                                                   ---------------
Alias                                  Alias
C                  52,39         44,97 FileSystem    C:\                                                                                                                   Windows\system32
Cert                                   Certificate   \
D                 218,60        149,80 FileSystem    D:\
E                                      FileSystem    E:\
Env                                    Environment
Function                               Function
HKCU                                   Registry      HKEY_CURRENT_USER
HKLM                                   Registry      HKEY_LOCAL_MACHINE
Variable                               Variable
vi                                     VimInventory  \LastConnectedVCenterServer
vis                                    VimInventory  \
vmstore                                VimDatastore  \LastConnectedVCenterServer
vmstores                               VimDatastore  \
WSMan                                  WSMan

To get your typical data warehouse 'cd ":

CD vmstores:\your_vcenter\your_cluster

On each level, you can do 'ls' or 'cmd '. Tab completion works on everything in order to use it

From now on, all depends on what you already have and what it looks like. These files have a naming pattern names containing the name of the virtual machine or other information ("backup", "tmp" etc.)? You have these names stored somewhere? In text or csv file?

I guess you have the list of files in the text file. So much more simple method would be to be scan all data warehouses and all files. As you can imagine it is very time and resource consumption, so not recommended to all

#we're importing filenames to variable
$oldfiles = Get-Content your_text_file.txt
cd vmstores:\your_vcenter\your_cluster
$oldfiles | ForEach-Object {
#we're recursivly looking for file stored in $_ special variable (current object)
$deleteme = Get-ChildItem $_ -Recurse
#deleting the file
Remove-Item $deleteme.PSPath
}

If the file names that you already can somehow correspond directly to the VM, then we could use a more intelligent approach.

Let's say we have the testVM001 - bak003.vmdk and VMname file is testVM001. We can remove all characters after the 9th tank and then work on it:

#we're importing filenames to variable
$oldfiles = Get-Content your_text_file.txt

$oldfiles | ForEach-Object {
    #getting VM name
    $vmname = $_.Remove(9)
    #getting VM path
    $vmpath = (Get-VM -Name $vmname |Get-Datastore).DatastoreBrowserPath
    #combining full path
    $fullpath = $vmpath + "\" + $vmname
    cd $fullpath
    #deleting the file
    Remove-Item ./$_
}

These are simple ideas, it could be useful.

Tags: VMware

Similar Questions

  • Looking for some practice files for video in line/book of "Adobe Photoshop CS5 Extended: Essentials. I use the tutorial via membership in Safari book online and the files are not available on Safari.  Do you know where I can get the files?

    Looking for some practice files for video in line/book of "Adobe Photoshop CS5 Extended: Essentials. I use the tutorial via membership in Safari book online and the files are not available on Safari.  Do you know where I can get the files?

    Looks like the manufacturer was "Total Training. I can't find the title to Adobe.com

    http://totaltraining.com/store/Photoshop-CS5-extended-Essentials/

  • Fortunately, I have download my Canon 7 d CR2 files using Photoshop elements 11; but when I do the same thing with a Canon G7X files are not recognized.  I downloaded the latest update of Adobe for RAW files.  Advice gratefully received.

    Fortunately, I have download my Canon 7 d CR2 files using Photoshop elements 11; but when I do the same thing with a Canon G7X files are not recognized.  I downloaded the latest update of Adobe for RAW files.  Advice gratefully received.

    You need Adobe raw camera 8.7 version. Unfortunately your software is earlier than the camera. ACR 8.7 is only compatible with PSE13. But it is possible to download and install the free DNG Converter to convert your raw files to the universal Raw format files and Adobe will be open in all versions of PSE (keep your originals as backups and for use in the software of the camera factory)

    Download Windows (.exe file) click here DNG Converter 8.7

    Download Mac (.dmg file) click here DNG Converter 8.7

    You can convert an entire folder of images raw with a single click. See this quick video tutorial:

    You Tube click here for the DNG Converter tutorial

  • I use LR 4.4.  Just picked up a Sony RX100 M3 cam. Its RAW files are not supported in my version. Y at - it a free upgrade always available for my version, or what I have to buy an upgrade to LR5?

    I use LR 4.4.  Just picked up a Sony RX100 M3 cam. Its RAW files are not supported in my version. Y at - it a free upgrade always available for my version, or what I have to buy an upgrade to LR 5?

    Camera Raw plugin | Supported devices

    The Sony RX100 III was first supported by Lightroom 5.5.

    There will be no updates for older versions.

    If your choice:

    1. Update to Lightroom 5, or
    2. Download the free Adobe DNG converter, convert all the RX100 III Raw files to DNG, and then edit the DNG in Lightroom 4.4
      Using Photoshop | Digital Negative (DNG)
  • y at - it a button to remove all the nuances that are not used in an file?

    Hey all,.

    I was wondering is there a button that removes all the nuances that are not used in an illustrator file?

    Any help would be great

    Look in the Actions Panel. It should be an action he who says to remove all unused items in the Panel.

  • Multimedia player that allows some of my WAV files to be played in a more quick read but other WAV files are NOT allowed to read at a faster speed.

    original title WAV file: windows media player

    Multimedia player that allows some of my WAV files to be played in a more quick read but other WAV files are NOT allowed to read at a faster speed.  Any suggestions on how to fix?

    Thank you

    Hello
    1 did you change on your computer before this problem?
    2. what happens when you try to play?
    3. what operating system is running on your computer?

    What version of the operating system Windows am I running?
    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running
    Follow the suggestions and see if it helps.

    Method 1

    You can run Windows Media Player settings convenience store.
    Open the troubleshooting Windows Media Player settings Troubleshooter
    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

    Method 2
    You can read the article and then check.
    Change playback speed in Windows Media Player
    http://Windows.Microsoft.com/en-us/Windows7/change-playback-speed-in-Windows-Media-Player

    See also:
    Play an audio or video file: frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows7/play-an-audio-or-video-file-frequently-asked-questions
    Play an audio or video file
    http://Windows.Microsoft.com/en-us/Windows7/play-an-audio-or-video-file

     
  • Clink Manager. script/util/common js by default Java files are not included

    Clink Manager. script/util/common js by default Java files are not included. I got this when I tried to send pictures to Walgreens.

    What it means

    Hello

    1. what browser you use to upload photos?
    2. If you use Internet Explorer (IE), then what version?
    3. What is the format of the files you are trying to download?

    If you use Internet Explorer, then try to reset IE and check if it helps.

    Refer to this article for help:
    http://support.Microsoft.com/kb/923737

    Note: the Internet Explorer the reset parameter would delete all browsing history, saved passwords and forms on your computer.

    Please provide us with some information so that we can help you solve the problem.

    Kind regards
    Afzal Taher - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • .exe files are not open; affected by the Windows Security Center of lazy virus

    Hello!

    As the title indicates, none of my executables will open his; on the contrary, when I click on an icon or similar function (as in the start menu), I'm inclined to the screen 'open with... ». I noticed that most often, if I run the program as administrator, it is likely to work without having to manually find the file - still a bit tedious however.

    I'm assuming that since I was recently hit by the virus which is a fake Windows Security Center, something my registry has also been hit (take into account the fact that I'm not savvy computer in the slightest). It happened on my user account initial and rather than take action on the right, then, I decided that I would use the other account that I had to install a program better anti-virus (Norton provided ISP) than the one I had been using (the two admin). At that point, I had finished all my activity moved to the new account and it worked very well until the virus had one possessing this account as well - delete on the first user account seemed to have deleted only the effects of my account but still affected everything I did after that. This time, I went and deleted all accounts and checked to ensure that it is not at all. After getting rid of the virus, it's the same thing: none of my .exe files will open without using the monitor "open with...". ». I'm not really sure what action to take from here, I have not done much to remedy the situation, and I'm going right through the screen of "open with...". "to get to what whatever - so any suggestions or help would be very appreciated.

    Keypoints:

    • .exe files are not open (However, in some cases, the "Run as Administrator" option overrides it)
    • recently hit with (deleted) and fake Windows Security Center virus ; That's when the .exe is no longer
    • is not much in terms of addressing this problem, do not know what to do with regard to the question of if my situation calls for something specific

    I tried to cover everything that seemed important to address; However, if there is more need information, let me know. I am about average in terms of computer navigation and therefore my understanding of what many of these commands, functions and files is a bit Basic.

    Thank you! :)

    Thanks for the very comprehensive post. Run the Doug Knox fix (that isn't a .exe that you can do this).

    http://www.dougknox.com/XP/file_assoc.htm

    Then follow the instructions to delete here:

    http://www.bleepingcomputer.com/virus-removal/remove-antivirus-Vista-2010

    MS - MVP - Elephant Boy computers - don't panic!

  • Shairng private network file - files are not properly sharing

    I am a small business owner. I set up a private network. Instead of sharing in the 'Public' folder, I identified individual files and does the work to ensure the sharing of files. The files are "marked" as being shared in the network and sharing Center files appear when I click on "Show me the folders and files that I share", but when entering the network, the files are not displayed.

    Protection options password for account currently OFF sharing. Other sharing (print, media, CAD drawings) work.

    How to solve this problem?

    We have a laptop running Windows 7. two laptops and two desktops running Vista. All versions are Home Premimum and basically serve us well.

    Hello

    You must open a new folder under the main hard drive (or any disk storage) (you can also add void structure of folders for) and share the new folder as a whole. and leave only the public folders. Move the relevant files to the new folder structure.

    Maybe this can help more.

    -- ---------------------

    This message looks like a long history because I don't know what is the level of knowledge of the user, and what has already been done.

    The info goes through the motions of the configuration and verify most of the common aspects of the functionality of Windows OS' LAN.

    ----------------------

    Win7 when configured on the peer-to-peer network has three types of configurations of sharing.

    Group residential network = only works between Win 7 computers. This type of configuration, it is very easy to entry level users to start sharing network.

    Working network = fundamentally similar to previous methods of sharing that allow you to control what, how and to whom the records would be shared with.

    Public share
    = network Public (as Internet Café) in order to reduce security risks.

    For the best newspaper of the results of each computer screen system and together all computers on a network of the same name, while each computer has its own unique name.

    http://www.ezlan.NET/Win7/net_name.jpg

    Make sure that the software firewall on each computer allows free local traffic. If you use 3rd party Firewall on, Vista/XP Firewall Native should be disabled, and the active firewall has adjusted to your network numbers IP on what is sometimes called the Zone of confidence (see part 3 firewall instructions

    General example, http://www.ezlan.net/faq#trusted
    Please note that some 3rd party software firewall continue to block the same aspects it traffic Local, they are turned Off (disabled). If possible, configure the firewall correctly or completely uninstall to allow a clean flow of local network traffic. If the 3rd party software is uninstalled, or disables, make sure Windows native firewall is active .

    Since you have a network with Win 7 and the other version of Windows, you must configure Windows 7 as work network.

    In the center of the network, by clicking on the type of network opens the window to the right.

    Choose your network type. Note the check box at the bottom and check/uncheck depending on your needs.

    http://www.ezlan.NET/Win7/net_type.jpg

    Win 7 - http://windows.microsoft.com/en-us/windows7/Networking-home-computers-running-different-versions-of-Windows

    Win 7 network sharing folder specific work - http://www.onecomputerguy.com/windows7/windows7_sharing.htm

    Vista file and printer sharing - http://technet.microsoft.com/en-us/library/bb727037.aspx

    When you have finished the configuration of the system, it is recommended to restart everything the router and all computers involved.

    -------------

    If necessary check specifically Permission/security settings.

    Point to a folder that wants to share do right click and choose Properties.

    In the properties

    Click on the Security tab shown in the bellows of the photo on the right) and verify that users and their permissions (see photo below Centre and left) are configured correctly. Then do the same for the authorization tab.

    This screen shot is to Win 7, Vista menus are similar.

    http://www.ezlan.NET/Win7/permission-security.jpg

    The Security Panel and the authorization Panel, you need to highlight each user/group and consider that the authorization controls are verified correctly.

    When everything is OK, restart the network (router and computer).

    Please note that the users and groups listed on the screen shoot are just an example. Your list will focus on how your system is configured.

    ---------------------

    * Note. Some of the processes described above are made sake not for Windows, but to compensate for different routers and how their firmware works and stores information about computers that are networked.

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • temporary internet files are not deleted

    How to fix... internet .temporary files are not deleted after cleaning disc running on windows 7, IE9

    Hello

    1. have there been recent changes to the system before the show?

    2 have you installed security software installed on your system?

    Method 1:

    Follow the link below, disable the security software and try to delete the temporary Internet files.

    Disable the anti-virus software

    http://Windows.Microsoft.com/en-us/Windows7/disable-antivirus-software

    Note: make sure that you enable the antivirus software once you have completed troubleshooting.

    Method 2:

    Follow the link, take possession of the file/folder and then try to delete temporary Internet files.

    Appropriating a file or a folder

    http://TechNet.Microsoft.com/en-us/library/cc753659.aspx

    Method 3:

    Follow the link below and do a Virus Scan and then try to delete the files.

    Check if it helps.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Let us know if it helps.

  • Hello, I downloaded a new Web site, but all the svg files are not displayed on the browsers. When I opened it in Muse with the "Preview in browser", its fine! can someone tell me please where is my problem? (Sorry for my English!)

    Hello, I downloaded a new Web site, but all the svg files are not displayed on the browsers. When I opened it in Muse with the "Preview in browser", its fine! can someone tell me please where is my problem? (Sorry for my English!)

    Hello

    Could you please check this thread, it might be useful

    Muse exporting is not svg, can only see Preview

  • How to check the HP files as not being is not a virus?

    I have a Compaq Presario SR2027X desktop computer comes with XP Media Center 2005. It has been updated to SP3.

    Recently, I ran free TDSSKiller from Kaspersky Lab to check my PC for the DNSChanger Malware. After executing TDSSKiller, he registered 6 files to be suspicious. Both files from HP. The files and their paths are:

    (1) LSSRVC.exe.  Path: C:\Program Files\Fichiers Files\LightScribe\LSSrvc.exe

    (2) HPZipm12.exe. Path: C:\WINDOWS\System32\HPZipm12.exe

    How to check that these files have not been modified by a virus?

    Thanks, Terry

    It may be simply a false opinion. Try another scanner as MS:

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

  • the .ocx files are not registered?

    My installer does not correctly load the .ocx files. Sometimes the .ocx files are not registered? I'm using Labview 8.2.1 and this problem usually happens with Vista Machines.How can correct this?

    Your done installer places these OCX files in the system32 directory, or is it another Installer? If you do, you can then run an additional executable to the regsvr32. Please just make sure that the program is running under administrative privileges for Vista. See How to make my build LabVIEW Installer run an executable after Installation?

  • Clips files are not empty, but he says they are

    Hello

    I have a Sansa clip 4 GB, Version 1.02.16A mb memory settings 3744 for free shwning 316 under info.

    All my files were in audio books and podcasts. Now these files shw vacuum on the drive, BUT some shw upward in artists, albums, artists and such files. Not everyone understands them.

    When I connect it to my computer, the clip said it's almost full, but all the files are empty.

    I tried pressing the power button for more than 20 seconds and it will not reset.

    I tried to download the firmware zip file and install in the root directory. Updated the firmware.

    I tried to put it in USB MSC mode, pressing the Center button and its connection to my computer.

    Nothing seems to work. Any ideas please?

    Thanks in advance.

    I guess that your files are not correctly tag. You can format the drive using the Player menu (settings, system settings, format) that will remove the files on the drive.

    You must edit the files on your pc and correctly label, then again to copy them in the drive.

    The program free mp3tag is very useful for marking files. The player must id3v2.3 tags iso8859-1.

    http://www.mp3Tag.de/en/

  • My Recycle Bin does not work. Deleted files are not stored in the Recycle Bin.

    My Recycle Bin does not work. Deleted files are not stored in the Recycle Bin.
    When I delete a file, none of these files are saved in the Recycle Bin.

    tried to restore desktop icons. no use.

    Tried to change the icons as method 2. Yet, my deleted files are not saved in the trash.

    My last bag of stuff.
    I assume that your allotted basket size is too small or you were not "empty" the collector for a LONG time.

    Right click on the Recycle Bin > properties > size under Custom, how many MBs are awarded?
    Mine is 1023 MB. I saw someone almost 5000 MB.

    Increase size, play with the numbers until the darn bac actually works the way it should be.
    Please post back. I'm curious to know the result.

    t-4-2

Maybe you are looking for

  • Satellite A200 PSAECE - fan of Windows 7 (& BIOS)

    Dear community, I installed the latest version of BIOS Toshiba offers for Windows Vista (v.1.80 21/08/07) and I'm running on Windows 7 on a Satellite A200 PSAECE. The fan is very VERY strong. I've heard talk of a solution would be to return to a prev

  • Satellite P300 - is - it normal that the buttons CD/DVD turns on the laptop?

    Hi all My laptop is Satellite P300 - PSPCCE. I noticed that if the laptop is off and press the CD/DVD function it turned on and play Windows media player. My question is - is this normal, and if this normal how to disable this option? Thank you

  • Volume icon missing?

    I lost the volume icon in the taskbar.  When I go to the taskbar and launch the properties of the menu of the volume box is gray and so can't check so that it appears in the task bar.  Any suggestions? Not sure if I do it properly or not.

  • Windows XP updates

    I have dicided to reistall windows XP on my computer. I can't get updates. I am connected to the internet. Windows updates is activeted at any automatic dowlod up-to-date. Can someone help me or give advice?

  • SWMagent keeps restarting on my laptop.

    Original title: SWMagent SWMagent keeps restarting on my laptop but I don't know what you could help you?