Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows Server

การกำหนดค่า Hyper-V Live Migration โดยไม่มี Failover Clustering

บทนำ

เทคโนโลยี Live Migration ในระบบเสมือน hóa Hyper-V ช่วยให้สามารถย้าย Virtual Machine ที่กำลังทำงานระหว่าง Hyper-V Hosts ได้โดยไม่ต้องหยุดหรือส่งผลต่อความพร้อมใช้งานของบริการ ใน Hyper-V รุ่นก่อน สามารถย้าย VM ระหว่างโหนดของ Failover Cluster เท่านั้น ข้อจำกัดนี้ถูกลบออกใน Hyper-V 3.0 (Windows Server 2012) ขึ้นไป เนื่องจากเทคโนโลยี Shared Nothing Live Migration บทความนี้จะแสดงวิธีเปิดใช้งาน Live Migration และย้าย VM ที่ทำงานอยู่ระหว่าง Stand-alone Hyper-V Hosts ที่รัน Windows Server 2016

ข้อกำหนด Shared Nothing Live Migration

  1. ย้ายระหว่างเซิร์ฟเวอร์ที่รัน OS: Windows Server 2012 R2 หรือ Windows Server 2016
  2. Virtual Machine Version ต้องเป็น 5 หรือสูงกว่า
  3. ทั้งสองคอมพิวเตอร์ต้องอยู่ใน Active Directory Domain เดียวกัน หรือ Trusted Domains
  4. User ที่ทำการกำหนดค่าต้องมีสิทธิ์ Hyper-V Administrator ในการตั้งค่า Kerberos Constrained Delegation User ต้องมีสิทธิ์ Domain Admin (หรือ Server Account Privileges)

ขั้นตอนการกำหนดค่า

สมมติมี 2 เซิร์ฟเวอร์ Windows Server 2016 พร้อม Role Hyper-V: Srv01 และ Srv03 ทั้งคู่เป็นสมาชิก AD Domain และไม่ได้ Cluster (Windows Server Failover Clustering) เปิด Hyper-V Manager บนเซิร์ฟเวอร์ใดก็ได้ และเพิ่มทั้งสองเซิร์ฟเวอร์เข้าไป

เปิดใช้งาน Live Migration

  1. Right-click Hyper-V Server → Hyper-V Settings
  2. ไปที่ Section Live Migration
  3. Check Enable incoming and outgoing live migrations
  4. จำกัดรายการ Migration ให้เป็น IP Address ของ Hyper-V Hosts ทั้งสอง
  5. เลือก Use Kerberos เป็น Authentication Protocol ใน Section Advanced Features

ทำได้ด้วย PowerShell เช่นกัน:

Enable-VMMigration
Set-VMMigrationNetwork 192.168.10.41 192.168.10.21
Set-VMHost -VirtualMachineMigrationAuthenticationType
หมายเหตุ: VM Live Migration ทำได้ด้วย CredSSP Protocol ด้วย แต่ Administrator จะต้อง Sign-in (ผ่าน RDP) บนเซิร์ฟเวอร์ที่เป็น Source ของ Migration หรือเชื่อมต่อ Remote ผ่าน PowerShell Remoting

สำหรับ Kerberos Authentication Administrator ไม่ต้อง Sign-in บนเซิร์ฟเวอร์ แต่ต้องตั้งค่า Constrained Delegation ใน Active Directory (KCD — Kerberos Constrained Delegation)

การตั้งค่า Kerberos Constrained Delegation (KCD)

  1. เปิด ADUC Snap-in หา Account ของ Hyper-V Server แรก → Properties → Tab Delegation
  2. Check Trust this computer for delegation to specified services only และ Use Kerberos only → คลิก Add
  3. ในหน้าต่างถัดไป คลิก Users and Computers ระบุชื่อ Hyper-V Server ที่สอง ในรายการ Services เลือก Microsoft Virtual System Migration Service
  4. Tip: หากต้องย้าย VM Storage ด้วย ให้เลือก Protocol cifs เพิ่มเติม
  5. Save Delegation Settings ทำซ้ำสำหรับ Hyper-V Server ที่สอง

รอการ Replicate ของการเปลี่ยนแปลงใน AD และ Re-issue Kerberos Ticket แล้วค่อยทำ Live Migration VM: Right-click VM → Move → เลือก Move the virtual machine → ระบุชื่อ Hyper-V Host ปลายทาง → เลือกโฟลเดอร์บน Target Host (ต้องมีอยู่แล้ว) → Finish

Tip: เริ่ม Migration ด้วย PowerShell: Move-VM srvapp1 Srv01 -IncludeStorage -DestinationStoragePath c:\hyperv\vm

ปัญหา Processor Compatibility

หาก Processor Compatibility ไม่ได้เปิดใน VM Settings Migration จะหยุดพร้อม Error:

The virtual machine cannot be moved to the destination computer. The hardware on the destination computer is not compatible with the hardware requirements of this virtual machine.

แก้ไขโดย Shutdown VM และเปิด CPU Compatibility:

Set-VMProcessor srvapp1 -CompatibilityForMigrationEnabled $true