How to remove vmkdump files from VMware ESX 5.x

So how can a datastore be deleted if there is an active file in a vmkdump folder that resides in the datastore running Vsphere Client and ESX 5.x?

When browsing the datastore, a vmkdump folder shows up with a file in it, this file is in use and prevents the datastore to be deleted, it is a log dump file and in my case could be remove and re-added safely to another store.

The files cannot be migrated by the Vsphere Client and trying to do so or delete dem gives an error: “Device or resource busy”

One .dumpfile is created by each host in a random datastore, and to delete and recreate them, you have to find the owner of the file, to do so, take the ID of the file and log in to your hosts by this adress to find their ID which have to match the filename:

https://SERVERNAME/mob/?moid=ha-host&doPath=hardware.systemInfo

then logon to the ESX host with putty, and run this command: “esxcli system coredump file remove –F”

Then recreate the file at a new destination with: “esxcli system coredump file add -f SERVERNAME -d DATASTORENAME”

Make the file active: “esxcli system coredump file set -p /vmfs/volumes/DATASTORE_UUID/vmkdump/FILENAME”

Run this command to see if the file is active: “esxcli system coredump file list”

So to solve this puzzle, these to blogs did the math.

http://jbcomp.com/remove-vmkdump-files/

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2077516

How to use Robocopy and RichCopy to Migrate TB of data

When i tried using RoboCopy for my data migration tasks, I found out that it would take way to long since the data transfer speed on RoboCopy was quite poor.

Looking for other alternatives i found Microsoft RichCopy that did the trick.

But RichCopy comes up with some errors like “file not found” “directory not found” and i have a hard time trusting this output.

So instead i used Robocopy afterwards to verify the data, RoboCopy will only copy changes or files not copied by RichCopy and even if RoboCopy says “modified” in the output does not meen that it copies all the data Again, it only copies changes. I uses these commands which catched the missings links from RichCopy.

robocopy <source> <destination> /XO /ZB /E /FFT /DCOPY:T /COPYALL /R:1 /W:1 /V /NDL /MT:20 /LOG:<location&name>.log /TEE
/XO – Excludes files from <source> that are older then the <destination> files.
/ZB – Uses Restart mode. If access is denied, this option uses Backup mode.
/E – Copies subdirectories. Note that this option includes empty directories. For additional information
/DCOPY:T – Copies directory time stamps.
/COPYALL – All security information on files and folders are copied.
/R: – Specifies the number of retries on failed copies. The default value is 1,000,000 (one million retries).
/W: – Specifies the wait time between retries, in seconds. The default value of N is 30 (wait time 30 seconds).
/V – Verbose output showing skipped files
/NDL – Specifies that directory names are not to be logged.
/MT – Creates multi-threaded copies with N threads. N must be an integer between 1 and 128. The default value for N is 8.
/LOG:<LogFile> – Writes the status output to the log file (overwrites the existing log file).
/TEE – Writes the status output to the console window, as well as to the log file.
/FFT – if the two server have the different file systems, files are still re-copied, even though nothing has changed. You can use /fft switch, which makes the modify time comparison more tolerant (2 seconds granularity).

This way i increased the copy speed and i’m positive that the data is intact after the migration.

Use this info at your own risk.

/Mads

Software Update Cleanup in System Center 2012 Configuration Manager

If you need some understanding on how software updates and cleaning up expired or superseeded updates works in System Center 2012 Configuration Manager – SCCM 2012, i can recommend this great little article that describes the automatic progress that runs in the background and also shows you the manuelt steps that can be done to remove old updates no longer needed.

http://blogs.technet.com/b/configmgrteam/archive/2012/04/12/software-update-content-cleanup-in-system-center-2012-configuration-manager.aspx

Best Regards

/Mads

SCVMM error 609 deploying from a Template – SOLVED

If you encounter that your SCVMM – System Center Virtual Machine Manager 2012 are giving you an error 609 when you try to install a new Virtual Machine from a template, you might want to ensure this settings:

  • If you have supplied a KMS key under the “Guest OS Profile” under Library\Profiles – Change it to a KMS key.

SCVMM Guest OS Profile

  • If you forgot to define the OS version of your Template server disk, do it under Library\Library Servers\

SCVMM Library Operating System

Then try to deploy your template again.

 

How to import existing computer objects to a SCCM 2012 collection with PowerShell

 Sometimes you need to add a lot of different already existing computer objects to a Configuration Manager collection.

 If you are lucky, these objects are placed in another collection or in a AD group, BUT – what if you just got a specific list of computers from someone ells that they would like to have updated with a certain application?

 Instead of adding the computer objects manually to the SCCM collection membership, you can add all object to an existing collection using Configuration Manager 2012 PowerShell.

 First: Create a collection in SCCM with the name you like

 Second: save the list of computers in a 1 column CSV file with the computer names only, remove all other information.

PowerShellComputers

 Third: Run this script and change the CSV file name and path and SCCM Collection Name.

$computers = Get-Content “c:\temp\computers.csv” | foreach {Add-CMDeviceCollectionDirectMembershipRule -CollectionName “COLLECTION NAME HERE” -ResourceId $(get-cmdevice -Name $_).ResourceID}

 At Last: Run this PowerShell script in the Configuration Manager Console PowerShell windows – at your own risk –  and please test with a single computer object first!

SCCMConsolePowerShell

I hope this tip will help you save some time.

Updating #FEP or #SCEP definitions gives error 0x80248014 – small fix required when using Windows Update as source

If you update Forefront Endpoint Protection from the agent shown below, it will sometime not update its definitions from Microsoft Update unless you have allowed the OS to receive updates from other products than Microsoft.

SCEPGUI

If you encounter something like the error code 0x80248014 below when updating FEP – Forefront Endpoint Protection or SCEP – System Center Endpoint Protection definitions, you need to make a small adjustment.

Microsoft Antimalware has encountered an error trying to update signatures.
New Signature Version:
Previous Signature Version: 1.173.226.0
Update Source: Microsoft Update Server
Update Stage: Search
Source Path: http://www.microsoft.com
Signature Type: AntiVirus
Update Type: Full
User: NT AUTHORITY\SYSTEM
Current Engine Version:
Previous Engine Version: 1.1.10502.0
Error code: 0x80248014
Error description: An unexpected problem occurred while checking for updates. For information on installing or troubleshooting updates, see Help and Support.

Forefront Endpoint Protection cannot get Definition updates from Microsoft Update unless you check this box “Give me updates for other Microsoft Products when I update Windows”:

Image

 

If SCCM 2012 show this Antimalware Policy configuration, the “Updates distributed from Microsoft Update” will not work until you have checked the box.

Image

You can use a VB script to change it:

Save the text below in a file with a VBS extension.

Set ServiceManager = CreateObject(“Microsoft.Update.ServiceManager”)
ServiceManager.ClientApplicationID = “My App”
‘add the Microsoft Update Service, GUID
Set NewUpdateService = ServiceManager.AddService2(“7971f918-a847-4430-9279-4a52d1efe18d”,7,””)

Run the below command in an elevated command prompt: cscript optinMU.vbs

 

The reverse step is also possible with a simple alteration:

Set ServiceManager = CreateObject(“Microsoft.Update.ServiceManager”)
ServiceManager.ClientApplicationID = “My App”
‘remove the Microsoft Update Service by GUID
ServiceManager.RemoveService(“7971f918-a847-4430-9279-4a52d1efe18d”)

Source: http://support.microsoft.com/kb/2832355