Tuesday, January 28, 2014

DPM–How to Mark Tape as Free

Sometimes we hit the issue of having difficulty of marking the Tape as Free in the DPM Library.    The tape is label as “Unknown” at times and can’t mark it as Free in the DPM Console. Then I scout around and found that I need to do this in PowerShell.

Copy the following Script (in green) into a Notepad and place into a directory in the DPM server.  Rename it as a powershell extention.  I name it as ForceFree.ps1.

param ([string] $DPMServerName, [string] $LibraryName, [string[]] $TapeLocationList)

if(("-?","-help") -contains $args[0])
{
Write-Host "Usage: ForceFree-Tape.ps1 [[-DPMServerName] <Name of the DPM server>] [-LibraryName] <Name of the library> [-TapeLocationList] <Array of tape locations>"
Write-Host "Example: Force-FreeTape.ps1 -LibraryName "My library" -TapeLocationList Slot-1, Slot-7"
exit 0
}

if (!$DPMServerName)
{
$DPMServerName = Read-Host "DPM server name: "

if (!$DPMServerName)
{
Write-Error "Dpm server name not specified."
exit 1
}
}

if (!$LibraryName)
{
$LibraryName = Read-Host "Library name: "

if (!$LibraryName)
{
Write-Error "Library name not specified."
exit 1
}
}

if (!$TapeLocationList)
{
$TapeLocationList = Read-Host "Tape location: "

if (!$TapeLocationList)
{
Write-Error "Tape location not specified."
exit 1
}
}

if (!(Connect-DPMServer $DPMServerName))
{
Write-Error "Failed to connect To DPM server $DPMServerName"
exit 1
}

$library = Get-DPMLibrary $DPMServerName | where {$_.UserFriendlyName -eq $LibraryName}

if (!$library)
{
Write-Error "Failed to find library with user friendly name $LibraryName"
exit 1
}

foreach ($media in @(Get-Tape -DPMLibrary $library))
{
if ($TapeLocationList -contains $media.Location)
{
if ($media -is [Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryManagement.ArchiveMedia])
{
foreach ($rp in @(Get-RecoveryPoint -Tape $media))
{
Get-RecoveryPoint -Datasource $rp.Datasource | Out-Null

Write-Verbose "Removing recovery point created at $($rp.RepresentedPointInTime) for tape in $($media.Location)."
Remove-RecoveryPoint -RecoveryPoint $rp -ForceDeletion -Confirm:$false
}

Write-Verbose "Setting tape in $($media.Location) as free."
Set-Tape -Tape $media -Free
}
else
{
Write-Error "The tape in $($media.Location) is a cleaner tape."
}
}
}

Double click on the DPM PowerShell in the DPM Server to launch the PowerShell


Type the powershell script that you’ve name it.  My example is ForceFree.ps1, therefore I keyed in as .\ForceFree.ps1


Then I keyed in the DPM Server Name, the Library Name and which slot of tape I want to Free it.


image


Once it’s done, then the tape can be re-use it.  Just go through the DPM Library and Erase it from the DPM Console.


Hope this helps. This article was simplified from TechNet.


keywords : DPM 2010, DPM 2012, DPM, free tape, mark tape as free, tape label as unknown, tape cannot erase


Wednesday, November 20, 2013

Remove Hidden Devices (does not display devices that are not connected)

I was having issues of booting up the VM.  It was corrupted of the XML for the VM.  So I re-created a new VM but attach back the Hard Disk from the old VM.

I boot up the new VM, then I was configuring back the IP address and suddenly it doesn’t allow me to input the IP address cause it indicated that it has been used.  I went into the Device Manager and see no items, even though I select “show hidden devices

The steps are the following that I do :

  • Open Command Prompt (run as administrator)
  • type devmgr_show_nonpresent_devices=1 then hit [Enter]
  • type start devmgmt.msc then hit [Enter]
  • Then click Show hidden devices in the View Menu
  • Remove the unnecessary devices (e.g. the Microsoft Hyper-V Network Adapter)

image

  • Then return to your NIC to input the IP address. 
  • It works for me !!

Thank you and hope this helps.

keywords : Device Manager does not display devices that are not connected to the Windows XP or Windows 2003 -based computer, Device Manager displays only non-Plug and Play devices, drivers, and printers when you click Show hidden devices on the Viewmenu. Devices that you install that are not connected to the computer (such as a Universal Serial Bus [USB] device or "ghosted" devices) are not displayed in Device Manager, even when you click Show hidden devices.

Friday, November 1, 2013

Can’t Remove VM in Hyper-V Manager (stuck)

Scenario

The VM was backup by ALTARO. The Anti Virus didn’t do an exclusion on the drive that the VM VHD was residing in.  The VM was corrupted after a few days.  A restore was done but it’s still unsuccessful.

image

When trying to cancel the restore, it just not successful. 

The challenge here is to remove the corrupted VM.  Even after restarting the Hyper-V Host, there’s still no success in removing the VM.

Resolution :

I look into the Task Manager and saw a few process that looks like below :

image

I found the Virtual Machine Worker Process (vmwp.exe).  I found one that is very low in memory that coincides with the Restore VM.

So I decided to kill the the process (the above was the snapshot after I terminated the process. I forgotten to take a snapshot of the low memory VM that was stuck.  It was like 4MB)

Then I go back to Hyper-V Manager and found that it allows me to remove the VM successfully.

image

This helps me and hope it helps you guys and gals too.

keywords : Virtual Machine, starting state stuck, workaround to remove stuck VM, Altaro restore, Virtualization, Virtual, restoring stuck

Tuesday, July 16, 2013

Protection Agent Installation Error (Error 313, 0x80070643)

 

Recently had issue in deploying the DPM 2012 agent to protect an old Windows Server 2003 client.

DPM Server DPM 2012 SP1
Protected Client Windows 2003 SP2

After going through the DPM Installation Wizard, the error came up as follow :

image

After some troubleshooting, found out that in order for the DPM 2012 SP1 to protect the Windows 2003 SP2, one of the pre-requisite is at least .NET 2.0 Framework.  The package can be downloaded from Microsoft website.

One other DPM pre-requisite is the Visual C++  Redistributable Package (have 2 versions – 64bit and 32bits depending on the OS)

error 313, 0x800070643, DPM agent installation error, DPM agent wizard installation error, Install protection agent failed

Thursday, July 4, 2013

How To Convert Physical to VHD

If you do not have the Virtual Machine Manager (VMM) to help you to convert the Physical Machine Hard Disk, then you can use another tool from the SYSINTERNALS .

To download this tool from the Microsoft Technet click Disk2vhd v1.63

Hope this helps as it has helped me.

keynote : Disk to vhd, physical to virtual, microsoft sysinternal, disk2vhd, VMM,

Thursday, April 4, 2013

How to Create Fixed Disk in VHDX using PowerShell

I’m going to share with you on how you can create the VHDX with Fixed Disk using PowerShell.  It’s fun and fast.

Firstly launch the PowerShell (running as Administrator)

Key in the following command :

New-VHD –Path “C:\ClusterStorage\Volume1\ServerVM\Virtual Hard Disks\ServerVMDisk2.vhdx” –size 50GB –Fixed

note : make changes in the yellow highlighted in your environment.  Please include the quotes “  ”.  As for the size, make the change accordingly in BLUE colour in the command above.

image

Can see the progress and wait (it’s much faster compared to GUI)

image

The Result as :

image

Hope the above steps help.

keynote : create fix disk , create fixed disk, create vhdx fix disk using powershell, PowerShell command, Hyper-V creating fix disk using powershell

Sunday, March 31, 2013

Checking ISO or DVD that is Still Attach to VMs (Using Powershell)

Sometimes we tend to forget to detach the DVD or ISO from the VMs.  So we would go in to individual VMs to check the setting.

image

So today I’m going to share what I learn by using the PowerShell, you can check all the VMs in one go.

In the PowerShell command (run as administrator), key in as

Get-VMDvdDrive *

and the results will be something as below :

image

So hopefully the steps above helps you.  Thank you Smile.

keywords : DVD, ISO, DVD & ISO in VMs, checking is ISO attach to VM, checking DVD attach to VM, Hyper-V with powershell