NIC 2013 - VM Mobility

74
VM Mobility with Hyper-V Kristian Nese CTO Lumagate

description

 

Transcript of NIC 2013 - VM Mobility

Page 1: NIC 2013 - VM Mobility

VM Mobility with Hyper-VKristian NeseCTOLumagate

Page 2: NIC 2013 - VM Mobility

Mobility Core to Private Cloud

• Virtualization is the basis of a Microsoft private cloud• Virtual machine mobility is key an efficient and responsive

private cloud deployment

Page 3: NIC 2013 - VM Mobility

Live Migration

Agenda

Page 4: NIC 2013 - VM Mobility

Live Migration without Infrastructure

• You can even live migrate virtual machines between two Hyper-V servers with no shared infrastructure• Need to be in the same domain

• Entire virtual machine moved (VHDs + running state) with no downtime

Page 5: NIC 2013 - VM Mobility

DEMO

LIVE MIGRATION

Page 6: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

Negotiation

Page 7: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

LM Connection

Page 8: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

LM Connection

Storage Migration

Page 9: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

LM Connection

Virtual Hard DisksStorage Mirror

Page 10: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

LM Connection

Virtual Hard DisksStorage Mirror

Live Migration

Page 11: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

LM Connection

Virtual Hard DisksStorage Mirror

Live Migration

Page 12: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

LM Connection

Virtual Hard Disks

Page 13: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

LM Connection

Virtual Hard Disks

Page 14: NIC 2013 - VM Mobility

Hyper-V Server 1 Hyper-V Server 2

VMMS VMMS

Virtual Machine

Virtual Hard Disks

Page 15: NIC 2013 - VM Mobility

PowerShell

• Move-VM “VM10" “TOMWAITS" • -IncludeStorage –DestinationStoragePath • “C:\VMS"

Page 16: NIC 2013 - VM Mobility

AGENDA

LIVE MIGRATION WITH SMB

Page 17: NIC 2013 - VM Mobility

Live Migration with SMB

• Storage is not moved, just the running virtual machine• Like live migration in a cluster, without high availability

• Requires SMB 3.0

Page 18: NIC 2013 - VM Mobility

Setting up SMB for Live Migration

• There are a couple of steps involved in getting this right• Both users and computers need access to the share

Page 19: NIC 2013 - VM Mobility

Setting up the share – Share Permissions

Page 20: NIC 2013 - VM Mobility

Setting up the share – Share Permissions

Page 21: NIC 2013 - VM Mobility

Setting up the share – Share Permissions

Page 22: NIC 2013 - VM Mobility

Setting up the share – File Permissions

Page 23: NIC 2013 - VM Mobility

Setting up the share – File Permissions

Page 24: NIC 2013 - VM Mobility

Setting up the share

Page 25: NIC 2013 - VM Mobility

Setting up the share

Page 26: NIC 2013 - VM Mobility

PowerShell

• MD X:\VMS• ICACLS.EXE X:\VMS --% /Grant Private\Administrator:(CI)(OI)F• ICACLS.EXE X:\VMS --% /Grant Private\TOMWAITS$:(CI)(OI)F• ICACLS.EXE X:\VMS --% /Grant Private\DAVIDBOWIE$:(CI)(OI)F• ICACLS.EXE X:\VMS /Inheritance:R• New-SmbShare -Name VMS -Path X:\VMS –FullAccess `• Private\Administrator, PRIVATE\DAVIDBOWIE$, PRIVATE\TOMWAITS$

Page 27: NIC 2013 - VM Mobility

DEMO

LIVE MIGRATION - SMB

Page 28: NIC 2013 - VM Mobility

PowerShell

• Move-VM “VM20" “THEWHO"

Page 29: NIC 2013 - VM Mobility

AGENDA

LIVE MIGRATION AND CLUSTERS

Page 30: NIC 2013 - VM Mobility

Live Migration Improvements

• Live Migration in Windows Server 2008 R2 is great• but how to make it better?

Page 31: NIC 2013 - VM Mobility

Live Migration Improvements

• Live Migration in Windows Server 2008 R2 is great• but how to make it better?

• Faster• Concurrent live migration• Deeper integration into clustering• Etc…

Page 32: NIC 2013 - VM Mobility

Live Migration between clusters• You can move a virtual machine between two clusters

• Follow these steps:• Remove the virtual machine from the source cluster• Use Hyper-V Manager to live migrate the virtual machine to a

node in the destination cluster• Join the virtual machine to the destination cluster

• Virtual machine never needs to be turned off• However, it is not protected from hardware failure during the

course of the migration.

Page 33: NIC 2013 - VM Mobility

DEMO

LIVE MIGRATION BETWEEN CLUSTERS

Page 34: NIC 2013 - VM Mobility

AGENDA

LIVE MIGRATION SECURITY

Page 35: NIC 2013 - VM Mobility

Configuring Live Migration

Page 36: NIC 2013 - VM Mobility

Ensure Live Migration Networks are Secure

• Physically Secure• IPSec / other encryption options

Page 37: NIC 2013 - VM Mobility

Managing security and authentication

• This gets very complicated once more than two computers are involved• And sometimes even when there are only two computers

involved

Page 38: NIC 2013 - VM Mobility

Credentials

Understanding credential security

Page 39: NIC 2013 - VM Mobility

Credentials

Understanding credential security

Credentials

Page 40: NIC 2013 - VM Mobility

Understanding credential security

Credentials

Page 41: NIC 2013 - VM Mobility

How this affects Hyper-V

Live Migrate

Page 42: NIC 2013 - VM Mobility

Live Migrate

How this affects Hyper-V

Live

Migrate

Page 43: NIC 2013 - VM Mobility

How this affects Hyper-V

Live Migrate a VM to me

Live Migrate

Page 44: NIC 2013 - VM Mobility

How to make this work?• Two options:

• Allow user credentials to be shared between the Hyper-V servers – just for the purposes of live migration• Enable “Constrained Delegation” in Active Directory

• Make it look like we are actually logged into the Hyper-V server that starts the live migration• PowerShell Remoting• Remote Desktop

Page 45: NIC 2013 - VM Mobility

Enabling Constrained Delegation• On the domain controller, open Active Directory Users and

Computers.• In the console tree, under DomainName, click Computers.• Right-click the computer running Hyper-V, and then click Properties.• On the Delegation tab, click Trust this computer for delegation to

specified services only.• Click either Use any authentication protocol or Use Kerberos only.• Click Add, and then click Users and Computers.• Type the name of the other computer running Hyper-V, and then click OK.• From the list of available services, select Microsoft Virtual System

Migration Service and CIFS and then click OK.

Page 46: NIC 2013 - VM Mobility
Page 47: NIC 2013 - VM Mobility
Page 48: NIC 2013 - VM Mobility
Page 49: NIC 2013 - VM Mobility
Page 50: NIC 2013 - VM Mobility
Page 51: NIC 2013 - VM Mobility

More Resources

• Taylor Brown’s Blog:• http://blogs.msdn.com/b/taylorb/

• Official Documentation:• http://technet.microsoft.com/en-us/library/jj134199

Page 52: NIC 2013 - VM Mobility

PowerShell Remoting with CredSSP

• On the server:• Enable-WSManCredSSP Server

• On the client• Enable-WSManCredSSP Client –DelegateComputer <FQDN of the server>

• Establish the session: • New-PSSession <FQDN of the Server> -Authentication CredSSP -Credential <User> |

Enter-PSSession

• Or just run a command:• ICM <FQDN of the Server> {<command to run>} -Authentication CredSSP -Credential

<User>

Page 53: NIC 2013 - VM Mobility

Remote Desktop

• Hopefully I do not need to tell you how to use this

Page 54: NIC 2013 - VM Mobility

AGENDA

LIVE STORAGE MIGRATION

Page 55: NIC 2013 - VM Mobility

Storage Migration

• Move any part of a running virtual machine with no need to turn it off• VHDs• Config files• Snapshots• Etc…

• Perform storage upgrades with no downtime• Respond to I/O bottlenecks with no downtime

Page 56: NIC 2013 - VM Mobility

Hyper-V

VHD Software

Storage Migration Architecture

Virtual Machine

Source Device Destination DeviceVHD

Page 57: NIC 2013 - VM Mobility

Hyper-V

VHD Software

Storage Migration Architecture

Virtual Machine

Source Device Destination DeviceVHD VHD

Page 58: NIC 2013 - VM Mobility

Hyper-V

VHD Software

Storage Migration Architecture

Virtual Machine

Source Device Destination DeviceVHD VHD

Page 59: NIC 2013 - VM Mobility

Hyper-V

VHD Software

Storage Migration Architecture

Virtual Machine

Source Device Destination DeviceVHD VHD

Page 60: NIC 2013 - VM Mobility

Hyper-V

VHD Software

Storage Migration Architecture

Virtual Machine

Source Device Destination DeviceVHD

Page 61: NIC 2013 - VM Mobility

DEMO

LIVE STORAGE MIGRATION

Page 62: NIC 2013 - VM Mobility

PowerShell

• Move-VMStorage "File Server 3" `• -DestinationStoragePath `• "K:\Virtual Machines\File Server 3"

Page 63: NIC 2013 - VM Mobility

Storage Migration – Performance• Data is moved with an un-buffered file copy operation

• XCOPY /J

• Causes a lot of I/O churn

Page 64: NIC 2013 - VM Mobility

Configuring Storage Migration

Page 65: NIC 2013 - VM Mobility

AGENDA

IMPORTING VIRTUAL MACHINES

Page 66: NIC 2013 - VM Mobility

Improvements to VM Import

• Basic building block of mobility• Improvements:1. Allow you to import a raw XML file2. Provide ability to “fix up” virtual machine during import

Page 67: NIC 2013 - VM Mobility

DEMO

IMPORTING A VM

Page 68: NIC 2013 - VM Mobility

PowerShellPS C:\> Import-VM "C:\Users\benarm\Desktop\Import\76F5DA48-5181-4E75-83ED-FB2F65B56C8F.xml" -Copy -VhdSourcePath "C:\Users\benarm\Desktop\Import"Import-VM : Unable to import virtual machine due to configuration errors. Please use Compare-VM to repair the virtual machine.At line:1 char:1+ import-vm "C:\Users\benarm\Desktop\Import\76F5DA48-5181-4E75-83ED-FB2F65B56C8F.x ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Import-VM], VirtualizationOperationFailedException + FullyQualifiedErrorId : Microsoft.HyperV.PowerShell.Commands.ImportVMCommand

Page 69: NIC 2013 - VM Mobility

PowerShellPS C:\> $VMCompatReport = Compare-vm "C:\Users\benarm\Desktop\Import\76F5DA48-5181-4E75-83ED-FB2F65B56C8F.xml" -Copy -VhdSourcePath "C:\Users\benarm\Desktop\Import"PS C:\> $VMCompatReport

VM : Microsoft.HyperV.PowerShell.VirtualMachineOperationType : ImportVirtualMachineDestination : BENARM-EPSILONPath : C:\Users\benarm\Desktop\Import\76F5DA48-5181-4E75-83ED-FB2F65B56C8F.xmlSnapshotPath :VhdDestinationPath : C:\Users\Public\Documents\Hyper-V\Virtual Hard DisksVhdSourcePath : C:\Users\benarm\Desktop\ImportIncompatibilities : {33012, 14420}

Page 70: NIC 2013 - VM Mobility

PowerShellPS C:\> $VMCompatReport.Incompatibilities | ft message

Message-------Could not find Ethernet switch 'Public'.Cannot assign the specified number of processors for virtual machine 'A random virtual machine' is out of range. The range is 1 through 12. (Virtual machine ID 76F5DA48-5181-4E75-83ED-FB2F65B56C8F)

Page 71: NIC 2013 - VM Mobility

PowerShellPS C:\> Set-VMProcessor -VM $VMCompatReport.VM -count 2PS C:\> get-vmnetworkadapter -VM $VMCompatReport.VM | disconnect-vmnetworkadapterPS C:\> import-vm $VMCompatReport

Name State CPUUsage(%) MemoryAssigned(M) ---- ----- ----------- ----------------- A random virtual machine Off 0 0

Page 72: NIC 2013 - VM Mobility

AGENDA

COMPARING TECHNOLOGIES

Page 73: NIC 2013 - VM Mobility

Zero Downtime

Protects against hardware failure

Protects against site failure

Protects against data corruption

Automatic response to failure

Workgroup compatible

Live Migration J L L L L LStorage Migration J L L L L JImport / Export L L L L L JClustering K J K L J LHyper-V Replica L J J K L JBackup L J K J L J

Page 74: NIC 2013 - VM Mobility

AGENDA

Q&A