Showing posts with label Windows 2008 R2. Show all posts
Showing posts with label Windows 2008 R2. Show all posts

Wednesday, July 27, 2016

Hyper-V VSS Writer State : [7] Failed Last error : Timed out

Had an issue of the Hyper-V VSS when I typed to check.

vssadmin list writers

image

In the event viewer I got as the following :

SNAGHTMLd65090\

I want to get the VSS back to be stabilize but not wanting to restart the server, therefore I restart a service.

image

Service to restart : Microsoft Virtual Machine Management

Keyword :

Volume Shadow Copy Service error: Unexpected error querying for the IVssWriterCallback interface. hr = 0x80070005, Access is denied.. This is often caused by incorrect security settings in either the writer or requestor process.Operation:  Gathering Writer Data Context:  Writer Class Id: {e8132975-6f93-4464-a53e-1050253ae220}  Writer Name: System Writer  Writer Instance ID: {bc497fa6-6627-47fb-a005-ac94fa83904e}Error : 8194 vssadmin list writer Hyper-V State 7 timed out

Thursday, May 26, 2016

Reset Local Administrator Password for Azure VM

Recently I had set up quite a couple of VMs in Azure and one of the VMs local administrator’s password I’ve keyed in wrongly and totally forgotten what is it anymore.

So in the Azure new portal there’s a feature to reset the password.

Local Administrator username : bkhoo

The steps taken are as below :

    image

    • On the left menu bar click on the Virtual Machines
    • In the Virtual Machines, select the specific Virtual Machine that want to reset the local administrator password.

    image

    • In the settings menu on the right, click Reset password .

    image

    • Key in the new password and confirm password, then click on Reset 

    Then I test it, I can now RDP into the VM using the new reset password .

    keywords : forgot password,local administrator password, Azure VM, Virtual machine password, how to reset local administrator password in virtual machine, VM, VMs, virtual machines

    Monday, April 4, 2016

    Killing a Hung VM in Task Manager (Another PowerShell command)

    This is another command of how to kill a Hung VM by identify the Process ID using PowerShell command :

    image

    For Windows 2012

    Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto

    For Window 2012 R2

    Get-WmiObject -Namespace root\virtualization\v2 -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft –auto

    Once the Process ID is obtain, launch the Task Manager and kill the VMWP.exe process with the correspondence Process  ID to that particular VM.

    image

    Hope this helps.

    keywords : hang VM, hung VM, stuck VM, Hyper-V virtualization stuck Server 2012 R2, vmwp.exe, killing vwmp.exe

    Killing a Hung VM in Task Manager

    Sometimes the VM we tried to stop hangs.  So in order to kill the process using the Task Manager, we can end process of VMWP.exe.  But the next question is which one.  Each VM has a unique Process ID.

    image

    Therefore, I launch the elevated Powershell by executing the following command below

    Get-WmiObject win32_process -Filter "Name like '%vmwp%'" | Select-Object ProcessID, @{Label="VMName";expression={(Get-VM -Id $_.commandline.split("")[1]|Select-Object VMName).VMName}}|ft –AutoSize

    image

    So I go back to the Task Manager and Right-Click on it and end task,base on the Process ID of that particular VM.

    image

    Hope this command helps you as it helped me.

    keywords : hang VM, hung VM, stuck VM, Hyper-V virtualization stuck Server 2012 R2, vmwp.exe, killing vwmp.exe

    Friday, March 11, 2016

    DPM 2012 Reporting Issue (ID : 220)

    After upgrading from SCDPM 2012 SP1 to SCDPM 2012 R2, I hit the issue when I tried to configure the Reporting to be send out periodically in the Report Module of SCDPM 2012 R2.

    image

    The steps taken was the following :

    • Launch the Reporting Services Manager (in my example is SQL 2008 R2, since it’s upgraded gradually from SCDPM 2012 SP1 to SCDPM 2012 R2)
    • Ensure to the correct database that I’m pointing to  (e.g. MSDPM2012)
    • Navigate to E-Mail Settings.
    • Key in the valid Sender Address and SMTP Server.
    • Click Apply

    SNAGHTML5532c4a

    • Launch the SCDPM 2012 R2 – Reporting
    • Configure the schedule reporting with emails, tested with no issues.keywords : SCDPM 2012, DPM cannot enable e-mail subscription for reports unless SMTP details are configured in the remote SQL Server Reporting Service Installation. SMTP details need to be configured manually when an existing SQL Server is chosen to be used for DPM during DPM setup.  Please enter the SMTP server name, SMTP port number and SMTP From address manually in the SQL Server Reporting Services configuration File.
      Configuration file path : c:\Program Files\Microsoft DPM\SQL\MSRS10.MSDPM2010\Reporting Services\ReportServer\RSReportServer.config
      The SMTP Server  details on the SMTP Servers tab in the Options dialog enables only DPM alert notifications. For more details, see DPM Help (ID : 220)
      SCDPM Report error, Systems Center Data Protection Manager Report Error, cannot configure email distribution in DPM report

    Friday, July 31, 2015

    Class 20409B - Server Virtualization with Windows Server Hyper-V and System Center

     

    Just finished conducting a 5-days class on Server Virtualization using Hyper-V and System Center.  During class, I shared real life scenarios on how it was implemented, what are the obstacles they will face if planning were not done properly in the first place before rolling out.

    Feeling happy that the students went back with knowledge.

    keywords : 20409, Hyper-V, virtualization, backup, protection, VMM, virtual machine manager, dpm, azure, cloud, vmmlibrary,

    Monday, April 7, 2014

    How to check Disk Space Usage and Free Space Remotely using PowerShell

    Scenario :

    Two hyper-V Host (clustered) with multiple VMs in it.  I need to check on the disk allocation, disk space usage & disk free space.  With the script below I’m going to share how I did it using PowerShell.  I just run it in one of the Hyper-V Hosts PowerShell.

    [Special credit to StackOverflow and BinaryNature.  I’ve made changes to ease the entry of variables]

    The credential used in the script must be part of the local administrators group

    # ----- Beginning of Script -----

    #Define ServerName (Physical/VM) Here

    # Change the Variables in PINK and remark out with # if the server or VM is not needed

    $PHY1="SVR1"
    $PHY2="SVR2"
    $AD1="ADVM1"
    $APP1="APPVM1"
    # $APP2="APPVM2"
    $DB1="DBVM1"
    $DP1="DPVM1"
    $DPM1="DPMVM1"
    $DomainUser = "domain\user1"

    # Diskfree Module

    function Get-DiskFree
    {
        [CmdletBinding()]
        param
        (
            [Parameter(Position=0,
                       ValueFromPipeline=$true,
                       ValueFromPipelineByPropertyName=$true)]
            [Alias('hostname')]
            [Alias('cn')]
            [string[]]$ComputerName = $env:COMPUTERNAME,
         
            [Parameter(Position=1,
                       Mandatory=$false)]
            [Alias('runas')]
            [System.Management.Automation.Credential()]$Credential =
            [System.Management.Automation.PSCredential]::Empty,
         
            [Parameter(Position=2)]
            [switch]$Format
        )
     
        BEGIN
        {
            function Format-HumanReadable
            {
                param ($size)
                switch ($size)
                {
                    {$_ -ge 1PB}{"{0:#.#'P'}" -f ($size / 1PB); break}
                    {$_ -ge 1TB}{"{0:#.#'T'}" -f ($size / 1TB); break}
                    {$_ -ge 1GB}{"{0:#.#'G'}" -f ($size / 1GB); break}
                    {$_ -ge 1MB}{"{0:#.#'M'}" -f ($size / 1MB); break}
                    {$_ -ge 1KB}{"{0:#'K'}" -f ($size / 1KB); break}
                    default {"{0}" -f ($size) + "B"}
                }
            }
         
            $wmiq = 'SELECT * FROM Win32_LogicalDisk WHERE Size != Null AND DriveType >= 2'
        }
     
        PROCESS
        {
            foreach ($computer in $ComputerName)
            {
                try
                {
                    if ($computer -eq $env:COMPUTERNAME)
                    {
                        $disks = Get-WmiObject -Query $wmiq `
                                 -ComputerName $computer -ErrorAction Stop
                    }
                    else
                    {
                        $disks = Get-WmiObject -Query $wmiq `
                                 -ComputerName $computer -Credential $Credential `
                                 -ErrorAction Stop
                    }
                 
                    if ($Format)
                    {
                        # Create array for $disk objects and then populate
                        $diskarray = @()
                        $disks | ForEach-Object { $diskarray += $_ }
                     
                        $diskarray | Select-Object @{n='Name';e={$_.SystemName}},
                            @{n='Vol';e={$_.DeviceID}},
                            @{n='Size';e={Format-HumanReadable $_.Size}},
                            @{n='Used';e={Format-HumanReadable `
                            (($_.Size)-($_.FreeSpace))}},
                            @{n='Avail';e={Format-HumanReadable $_.FreeSpace}},
                            @{n='Use%';e={[int](((($_.Size)-($_.FreeSpace))`
                            /($_.Size) * 100))}},
                            @{n='FS';e={$_.FileSystem}},
                            @{n='Type';e={$_.Description}}
                    }
                    else
                    {
                        foreach ($disk in $disks)
                        {
                            $diskprops = @{'Volume'=$disk.DeviceID;
                                       'Size'=$disk.Size;
                                       'Used'=($disk.Size - $disk.FreeSpace);
                                       'Available'=$disk.FreeSpace;
                                       'FileSystem'=$disk.FileSystem;
                                       'Type'=$disk.Description
                                       'Computer'=$disk.SystemName;}
                     
                            # Create custom PS object and apply type
                            $diskobj = New-Object -TypeName PSObject `
                                       -Property $diskprops
                            $diskobj.PSObject.TypeNames.Insert(0,'BinaryNature.DiskFree')
                     
                            Write-Output $diskobj
                        }
                    }
                }
                catch
                {
                    # Check for common DCOM errors and display "friendly" output
                    switch ($_)
                    {
                        { $_.Exception.ErrorCode -eq 0x800706ba } `
                            { $err = 'Unavailable (Host Offline or Firewall)';
                                break; }
                        { $_.CategoryInfo.Reason -eq 'UnauthorizedAccessException' } `
                            { $err = 'Access denied (Check User Permissions)';
                                break; }
                        default { $err = $_.Exception.Message }
                    }
                    Write-Warning "$computer - $err"
                }
            }
        }
     
        END {}
    }


    $cred = Get-Credential -Credential $DomainUser
    $PHY1, PHY2, $AD, $APP1, $APP2, $DB1, $DP1, $DPM1 | Get-DiskFree -Credential $cred -Format | Format-Table -GroupBy Name -AutoSize


    # ----- End of Script -----

    Steps

    My method was copy the script above (from Beginning to End of the Script)  into a notepad and make changes only to the PINK.  Please include the “ “ quotes as in the scripts. 

    (You can also save it as powershell script with ext of PS1 and run. Since this is a one time, I don’t intend to save it as PS1 file)

    After making the necessary changes, I copied the text and launch the PowerShell (need to run as Administrator) from one of the Hosts

    image

    …then I paste into the PowerShell screen and press [Enter]

    image

    It will display the credential, key in the password :

    image

    It will display something like below with the (servername or VM name as I’ve hide) :

    image

    Happy trying  and hope the script helps as it helps me.

    keywords : checking free space with powershell, powershell scripts, power shell script, checking space usage remotely, windows 2012 check disk space in VM

    Friday, March 28, 2014

    Unable to Backup using DPM or Local Windows Backup–missing VSS

    Here’s the scenario :

    • Two Windows Server 2012 running Hyper-V
    • Two Node Clusters
    • Backup software : DPM 2012 SP1

    When the VM resides on Host1, the DPM can backup VMs with no issue.  However when the VMs resides in Host2, the DPM fails to backup.

    Checked on the Host2 and found many errors of 8194.

    image

    To isolate further, I tried to backup Folders of Host2 using DPM, it still failed.  Additional to that, tried the Windows Backup locally on Host2, that too failed.

    Next is to try a tool which comes in Windows Server 2008 and Windows Server 2012.  It’s called the Diskshadow.

    C:\Diskshadow
    Diskshadow > set context persistent
    Diskshadow > set verbose on
    Diskshadow > begin backup
    Diskshadow > Add volume D: alias VolumeD

    The output as follow :

    image

    Next I did a comparison of Host1 and Host2 by using the command as follow in the Diskshadow

    Diskshadow > list providers

    Found out that Host1 has all 4 but Host2 has only 2 of the providers.  The missing ones are highlighted in the pink box.

    image

    So go to the following registry in Host1:

    HKEY LOCAL MACHINE\SYSTEM\CURRENT CONTROL SET\SERVICES\VSS\PROVIDERS

    image

    Export both the missing key registry from Host1

    image

    image

    Then in the Host2, I import both the keys that was exported above from Host1.

    In the Host2, I use the Diskshadow to check the providers :

    image

    Tried the backup from DPM, and it’s working already.  Hope this helps . 

    keywords : Microsoft Hyper-V VSS Writer failed retryable error, VSS Issue error 8194, DPM 2012 SP1, DPM backup fail ,

    Creation of recovery points for Backup Using Child Partition Snapshot on have failed. The last recovery point creation failed for the following reason: (ID: 3114)
    DPM encountered a retryable VSS error. (ID: 30112)

    Wednesday, February 19, 2014

    Performance Monitor–Create Data Collector Set Greyed Out

    Recently I tried to create a New Collector Set for the Performance Monitor for one of the customer’s request.  When I launched the Performance Monitor, click to create a new Data Collector Set and found it was greyed out.

    image

    After some troubleshooting, it seems that a service related to it was disabled.

    image

    All was done is click on the Properties of the Task Scheduler and select as Automatic Start Up.   You can click on the start to get the Task Scheduler instead of rebooting for this round.  Next time the server reboots, it will auto-start the services cause you have made the changes.

    Once that’s done, go back to the Performance Monitor and create the new Data Collector Set, the Next button is no more grey out.

    Hope this helps Smile.

    keywords : Performance monitor, next button grey out greyed out, task scheduler, cannot create data collecter set

    Monday, February 10, 2014

    DPM–Fail to Erase the Tape or Backup to Tape

    The Environment
    Operating System : Windows 2008 R2
    DPM Version : DPM 2010
    Tape Library : IBM TotalStorage 3573 Tape Library with 1 drive

    Issue faced when erasing or backup, the error prompted as failed.
    Error Message : The operation failed because of a protection agent failure. (ID 998 Details: Access is denied (0x80070005))

    SCR-154

    After some troubleshooting, found there’s a way to resolve this issue.  I changed the Tape driver in the DPM server.

    Steps carried out

    • Launch the Device Manager in the DPM server

    image

    • Locate the Tape Drives and right click, select Update Driver Software

    SCR-152

    • Select the “Let me pick from a list of device drivers on my computer

    SCR-153

    • Select the LTO Tape Drive (which is a native driver)
    • Click Next till it’s finished.
    • Then in the DPM console, select the Management and rescan it.
    • Now the Tape Drive is ready and working once you perform the Erase or Backup.

    Happy trying Smile

    keywords : The operation failed because of a protection agent failure. (ID 998 Details: Access is denied (0x80070005)), tape data erase, tape backup, DPM 2010, DPM2010, DPM, Status Failed, IBM TotalStorage 3573 Tape Library