Ask a questionAsk a question
 

Proposed AnswerMigration to CSV fails

  • Wednesday, November 11, 2009 2:26 PMJonathon Moore87 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    I have 3 host servers each running 3 guest servers and so far this has been fine. Now I've just bought an iSCSI SAN and created a cluster with my servers, at the moment all of my guests are stored locally on the hosts, to make them highly available I want to use the migrate storage wizard to move them onto the SAN. Unfortunately when ever I run the migrate storage wizard the wizard fails at the deploying file using LAN stage usually about halfway through transfering the files to the SAN. SCVMM gives me this error;

    Error (2927)

    A Hardware Management error has occurred trying to contact server <HostServer>

    (Unknown error (0x80338029))


    I have two networks set up in my cluster, one is my main network which everything is connected to I've got this set to "Allow cluster network communication" and "allow clients to connect through this network" the other is set to "do not allow cluster communication"

    The second network I described above is 1 switch connected to each of the hosts and to the SAN, that's it. I presume this makes it a dedicated storage network?

    I've been able to move VMs to the SAN by stopping the VM copying the VHD files to c:\clustered storage\volume1 and then creating a new VM using these VHDs but this means setting up all of the network addresses on the VM again and I don't really want to do that, also for the production servers I'd like to set the migration going overnight and know the servers will start when it's done, rather than having to setup a new virtual machine after the data is copied.

    Any one got any ideas?

    Thanks,
    Jon

All Replies

  • Friday, November 13, 2009 1:30 PMJuraj Lisiak Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Looks like there may be an underlying performance problem - you get good throughput and no errors manually copying the VHDs?


    Juraj
  • Thursday, November 19, 2009 6:17 PMPaul Svirin Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
  • Thursday, January 14, 2010 2:55 AMJanssen Jones [MVP Virtual Machine]MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed AnswerHas Code
    I've seen this issue before too, and ultimately gave up trying to migrate storage that way at that time.  Later, the problems mysteriously went away, so unfortunately, I can't help you with what may cause that specific issue (you may want to contact PSS to troubleshoot).  However, I *can* tell you that you can export/import VMs through PowerShell, and that would allow you to accomplish your task without having to recreate all of your network settings.  The Hyper-V export/import APIs aren't the easiest things in the world to use, but an overview is located at:

    That in turns points to some MSDN information.

    An example VBS version of the script that does this can be found at:

    A brief example of how the export might look in PowerShell (if you're only creating the export config files and not the VHDs):
    $VirtualSystemManagemntService = get-wmiobject -class "Msvm_VirtualSystemManagementService" -namespace "root\virtualization" -ComputerName $HyperVHost
    $tvm = Get-WmiObject -Namespace root\virtualization -Query "Select * From Msvm_ComputerSystem Where ElementName='$VMName'" -ComputerName $HyperVHost
    $VMGlobalSettingData = Get-WmiObject -Namespace root\virtualization -Query "Associators of {$tvm} Where ResultClass=Msvm_VirtualSystemGlobalSettingData AssocClass=MSVM_ElementSettingData" -ComputerName $HyperVHost
    $Destination = $VMGlobalSettingData.ExternalDataRoot + "_NewExport"
    $Msvm_VirtualSystemExportSettingDataPath = "\\"+$HyperVHost+"\root\virtualization:Msvm_VirtualSystemExportSettingData"
    $Msvm_VirtualSystemExportSettingData = ([WmiClass]$Msvm_VirtualSystemExportSettingDataPath).CreateInstance()
    $Msvm_VirtualSystemExportSettingData.CopyVmStorage = $false
    $Msvm_VirtualSystemExportSettingData.CopyVmRuntimeInformation = $true
    $Msvm_VirtualSystemExportSettingData.CreateVmExportSubdirectory = $false
    $Msvm_VirtualSystemExportSettingData.CopySnapshotConfiguration = 0 #0=All Snapshots, 1=No Snapshots, 2=Copy Specified Snapshot
    $Msvm_VirtualSystemExportSettingData.SnapshotVirtualSystem=$null #WMI Path to Msvm_VirtualSystemSettingData
    
    If that seems like more trouble than its worth, one other method I used to use before I got export/import working was to create a batch file on the desktop of each VM with a netsh script that set all of the network settings after I brought the VM back up.

    Here's an example PowerShell script of how you may go about creating the batch file:

    ###gather network information
    
    $vm = "name of vm you want to gather network info for"
    $IPinfo = gwmi win32_networkadapterconfiguration -comp $vm | ? {$_.IPAddress -ne $null}
    $username = "joesmith" # this is the user on who's desktop the config will be saved
    $IP = $IPinfo.IPAddress
    $SM = $IPinfo.IPSubnet
    $GW = $IPinfo.DefaultIPGateway
    $DNS1 = "1.2.3.4" # this should be your primary DNS
    $DNS2 = "5.6.7.8" # this should be your secondary DNS
    $WINS1 = "2.3.4.5"# this should be your primary WINS
    $WINS2 = "4.5.6.7"# this should be your secondary WINS
    $netsh = @"
    netsh interface ip set address name="Local Area Connection" static $IP $SM $GW 1
    netsh interface ip set dns "Local Area Connection" static $DNS1
    netsh interface ip add dns "Local Area Connection" $DNS2 index=2
    netsh interface ip set wins "Local Area Connection" static $WINS1
    netsh interface ip add wins "Local Area Connection" $WINS2 index=2
    
    netsh interface ip set address name="Local Area Connection 2" static $IP $SM $GW 1
    netsh interface ip set dns "Local Area Connection 2" static $DNS1
    netsh interface ip add dns "Local Area Connection 2" $DNS2 index=2
    netsh interface ip set wins "Local Area Connection 2" static $WINS1
    netsh interface ip add wins "Local Area Connection 2" $WINS2 index=2
    
    netsh interface ip set address name="Local Area Connection 3" static $IP $SM $GW 1
    netsh interface ip set dns "Local Area Connection 3" static $DNS1
    netsh interface ip add dns "Local Area Connection 3" $DNS2 index=2
    netsh interface ip set wins "Local Area Connection 3" static $WINS1
    netsh interface ip add wins "Local Area Connection 3" $WINS2 index=2
    
    netsh interface ip set address name="Local Area Connection 4" static $IP $SM $GW 1
    netsh interface ip set dns "Local Area Connection 4" static $DNS1
    netsh interface ip add dns "Local Area Connection 4" $DNS2 index=2
    netsh interface ip set wins "Local Area Connection 4" static $WINS1
    netsh interface ip add wins "Local Area Connection 4" $WINS2 index=2
    "@
    
    if (Test-Path "\\$vm\c$\users\$username\Desktop")  ### for W2K8 and later boxes
        {
        ac "\\$vm\c$\users\$username\Desktop\reconfigure-ip.bat" $netsh
        ac "\\$vm\c$\users\$username\Desktop\uninstall-hvguest.bat" $hvguest
        }
    elseif (Test-Path "\\$vm\c$\Documents and Settings\$username\Desktop") ### for W2K3 and earlier boxes
        {
        ac "\\$vm\c$\Documents and Settings\$username\Desktop\reconfigure-ip.bat" $netsh
        ac "\\$vm\c$\Documents and Settings\$username\Desktop\uninstall-hvguest.bat" $hvguest
        }
    else {"Couldn't find Path to save IP configuration info";}# break}
    
    I hope some of that information is helpful.  As to the reason why Storage Migration sometimes seems to randomly fail, I think it's probably best to contact PSS.

    Thanks,

    Janssen




    Janssen Jones - Virtual Machine MVP -http://www.janssenjones.com - Please remember to mark answers as answers. :)