Windows Server 2012–Hyper-V Best Practices Analyzer (BPA)

เมื่อติดตั้ง Hyper-V บน Windows Server 2012 มีความสามารถอันหนึ่งที่ Microsoft ช่วยวิเคราะห์ให้เราว่า การกำหนด parameter ต่างๆ นั้น เหมาะสมหรือไม่ วิธีนั้นง่ายมาก ทำตามนี้

1. Logon เข้า Windows Server 2012 ที่ติดตั้งแบบ GUI

2. เปิดหน้าจอ Server Manager กด Menu Manage เลือก Add Servers

3. ใส่ ชื่อ Server Hyper-V Host ที่ต้องการวิเคราะห์ลงไป

4. จากด้านซ้ายของหน้า Server Manager เลือก All Server

5. เลื่อน mouse ไปด้านขวา เลื่อนลงไปหา Best Practices Analyzer กดคำว่า Task แล้วกด Start BPA Scan ตามรูป

จากภาพอาจเห็นไม่ชัด ขออธิบายอันหนึ่ง ตรงที่ highlight คือ เครื่อง Guest Windows Server 2003 มี v-cpu มากกว่า 2 มันก็เตือนว่า ใส่ได้ 1-2 ก็พอ

image

Advertisement

ทำ Virtualization ด้วย Microsoft Hyper-V ลงทุนอะไรบ้าง

วิธีคิด Budget ง่ายๆ ของการติดตั้ง Hyper-V server สำหรับกิจการ SME เรามีคิดแบบรวดเร็ว พร้อมหรือยัง เริ่ม….

0. ของฟรีไม่มีในโลก ที่เราได้ยิน Hyper-V live migration หรือ VMware V-Motion โอ้พระเจ้า เครื่องของท่านมี High Availability อันนี้ต้องซื้อ ระบบ Management ของเค้า ไม่ฟรี  ดังนั้น ข้อ 0 นี้ขอให้ทำความเข้าใจกันก่อนว่า Virtualization ที่ดีนั้น ต้องการระบบบริหารจัดการหรือ System Management Tool ที่ดี มันมีค่าใช้จ่าย ในตอนที่ 2 จะมาบอกว่า Feature แบบไหนฟรี แบบไหนต้องมีค่าใช้จ่าย

1. Hypervisor

“Microsoft Hyper-V หรือ hypervisor คือ software ที่ทำให้เกิด virtualization ได้ Microsoft ไม่คิดเงิน Hyper-V ฟรี ส ำหรับ VMware version free อาจมีให้ทดลองใช้ แต่ถ้าสมบูรณ์ก็ไม่ฟรี  VMware มีค่าใช้จ่าย” 

ผู้ที่จะใช้ Hyper-V ต้องซื้อ Windows License ก่อนจึงจะเปิดใช้ Hyper-V ได้ เลือกทำ Hyper-V อย่างเดียวนั้นทำไม่ได้ ดังนั้น ฟรีสำหรับคนที่ซื้อ  Windows License  เท่านั้น

2. Windows OS License

Windows ต้องซื้อ จะใช้ไปลง vm บน Hyper-V หรือ VMware ก็คิดเหมือนกัน ใน Windows Server 2008 R2   แบ่งวิธีคิดเงินไปตาม Edition มี 3 แบบ

2.1 Standard Edition  อันนี้ลง Windows ได้ 2 ครั้ง ลงได้ 1 Physical + 1 VM ครั้งแรกลงบน Physical hardware เพื่อทำหน้าที่เป็น Hyper-V server  มีชื่อเรียกในฝั่ง Microsoft ว่า  Root Partition (ไ่ม่่ควรลง Program อื่นๆ ลงไว้บนนี้) ครั้งที่ 2 ลงใน vm มีข้อจำกัด ใช้ RAM ได้เพียง 32 GB และ 4 processor

2.2 Enterprise Edition ลงได้1 Physical + 4 VM ใช้ได้ 8 CPU RAM 2 TB (ถ้าจะทำ live migration ต้องเป็น Enterprise  ขึ้นไป)

2.3 Datacenter Edition ลงได้ 1 Physical + ไม่จำกัดจำนวน VM ใช้ได้ 64 CPU RAM 2 TB

3. Server

เป็น Server ที่มี CPU Intel หรือ AMD ก็ได้ แต่ต้องดูว่า support virtualization หรือไม่    เตรียม RAM ให้ Hyper-V สัก 2 GB  ที่ vm ต้องการเท่าไรบวกๆ เข้าไป ถ้าเครื่องมี slot RAM น้อย ก็พยายามซื้อ RAM ที่มีความจุสูงๆ เช่น 4,8,16 GB

4. Disk

จะเป็น Internal Disk, FC Array, iSCSI, USB 3.0 (2 ได้แต่ช้า) ก็ได้   ขอความจุเยอะๆ ไว้ก่อน VM ที่ลง Windows 1 ตัว ก็เตรียมไว้อย่างน้อย 40 -80 GB อันนี้เป็นไปตามคำแนะนำของ Microsoft ถ้าเป็นเครื่องทดสอบหรือไม่สนใจ  Performance จะมีน้อยกว่านี้ก็ได้ ใช้จริงๆ ไม่เยอะหรอก

5. Network

ขอให้มีอย่างน้อยเป็น switch 1 GB

6. Backup

ใช้ Windows Server Backup ที่มากับ Windows เพื่อ Backup ลง USB Disk ได้ ไม่มีค่าใช้จ่ายเพิ่มเติม

สรุป ค่าใช้จ่าย ก็ 1+2+3+4+5  จะเป็นเงินที่ต้องลงทุนกับ Hyper-V ครับ

เครื่องมือ 10 ตัว ที่ผู้คิดจะใช้ Hyper-V ควรรู้จัก

ได้พบบทความ Top 10 Microsoft Hyper-V tools to consider จาก ที่นี่ (searchwindowsserver.techtarger.com) แต่ผมขอเรียกเป็นภาษาไทยว่า เครื่องมือ 10 ตัวที่ผู้คิดจะใช้ Hyper-V ควรรู้จัก เพราะถ้าเรารู้จักเครื่องมือเหล่านี้ก่อนทำ Hyper-V อาจได้ประโยชน์มากกว่า ก็ลองอ่านต้นฉบับจาก link ผมขอทบทวนอีกครั้งตามลำดับต่อไปนี้

1. HVRemote เป็น script ที่ใช้ set hyper-v host ให้ยอมรับ การ admin ผ่าน remote เข้ามาจากเครื่องอื่น

http://itknowledgeexchange.techtarget.com/network-administrator/hyper-v-remote-management-configuration-utility/

1.1 ผมขอเสนอตัวนี้แทนข้อ 2 คือ CoreConfig เพราะเป็น GUI ที่รวมคำสั่งบน Windows Server Core ที่จำเป็นไว้ ใช้งานสะดวกมาก  http://coreconfig.codeplex.com/ 

2. Hardware-Assisted Virtualization Tool จาก Microsoft ใช้ประเมิน hardware ของเราว่าจะใช้ทำ Hyper-V Host ได้ไหม http://www.microsoft.com/download/en/details.aspx?id=592

2.1 ผมขอแนะนำเครื่องมือจาก Intel และ AMD แทน http://www.ditii.com/2008/06/23/will-my-computer-run-hyper-v-detecting-intel-vt-and-amd-v/

3.  RAMMap and VMMap เป็นเครื่องมือใช้ Monitor RAM อันนี้ยังไม่เข้าใจว่ายังไงกับ Hyper-V ท่านใดใช้เป็นลอง Comment มาเล่าให้ฟังบ้าง

http://blogs.technet.com/b/sysinternals/archive/2011/05/18/updates-vmmap-v3-1-rammap-v1-11-handle-v3-46-process-explorer-v14-12-and-mark-s-blog-analyzing-a-stuxnet-infection-with-the-sysinternals-tools-part-3.aspx

4. MAP Tools Kits ตัวนี้ใช้เก็บข้อมูลสำหรับการ Migrate  จาก Physical ไประบบ Hyper-V และอื่นๆอีกมากมาย

http://searchwindowsserver.techtarget.com/tip/How-MAP-Toolkit-65-can-put-you-on-the-right-migration-path

5. IOMeter ตัวนี้ใช้จัดการ Throughput ของ Storage

http://searchwindowsserver.techtarget.com/tip/Tuning-iSCSI-SANs-with-Iometer/

6. P2V Migration เป็นเครื่องมือ Convert physical 2 virtual

http://www.microsoft.com/download/en/details.aspx?id=3896

6.1 แนะนำ Disk2vhd จาก SysInternal

http://technet.microsoft.com/en-us/sysinternals/ee656415

7.VMC to Hyper-V  เครื่องมือ Migrate จาก Virtual Server ไป Hyper-V

http://blogs.technet.com/b/matthts/archive/2008/09/12/vmc-to-hyper-v-import-tool-available.aspx

8. vtCommander จาก 5nine ผมเคยเรื่องเกี่ยวกับ 5nine ไปแล้วทีนี่

9. VMDK to VHD Converter ก็คงตามชื่อ ถ้าจะย้ายจาก VMware ไป Hyper-V ในต้นฉบับไม่ระบุไว้ ก็ขอแนะนำอันนี้

http://www.sertec.ca/howtos/Howto-Convert-VMDK-to-VHD-Partition-types.html

10. Virtual Machine Servicing Tool – เครื่องมือลง Hotfix จาก WSUS สำหรับเครื่อง VM ที่ปิดอยู่

http://searchwinit.techtarget.com/news/1340068/New-tool-for-managing-offline-virtual-machines

สุดท้ายขอบอกว่าก็ต้องลองใช้กันดู แล้วอย่าลืมมาเล่าให้ฟังว่าเป็นอย่างไรบ้างนะครับ

Hyper-V Network ตอนที่ 2

วันนี้อยู่ในสถานะการปัญหาบน Virtual Network คือ เครื่องมี Network
onboard จำนวน 2
port และอยู่บน PCI 1 card มี 1 port เป้าหมายเราจะทำ Network Team แล้วใช้ Hyper-V Manager สร้าง Virtual Network ให้ผูกกับ Team ที่สร้างขึ้นมาใหม่ ผลที่ออกมาคือ Hyper-V Manager แสดงข้อความ “Error Applying New Virtual Network Changes” และ “Cannot bind to (ชื่อ virtual network) because it is already bound to another virtual network” ปัญหานี้ Microsoft ได้ออกวิธีแก้ไขตาม KB 2486812

จากที่อธิบายเบื้องต้นเกี่ยวกับ Hyper-V Network ในตอนที่ 1  
ว่า ขั้นตอนการสร้าง Virtual Network นั้น Hyper-V จะแปลงโฉม Physical Network Card ไปเป็น Virtual Switch ถ้าเราดูที่ Property ของ Card จะมีรายการชื่อ Microsoft Virtual Network Switch Protocol หรือเรียกย่อว่า vms_pp ผมตั้งสมมติฐานไว้เลยว่า ถ้า Network port ไหนถูกใช้งานเป็น Virtual Switch ไปแล้วจะใช้ซ้ำไม่ได้ ซึ่งเราอาจสงสัยว่าก็ทำงานผ่าน GUI มันผิดได้อย่างไร อันนี้เป็นปัญหาที่ Microsoft ต้องไปแก้ที่ต้นเหตุหรืออาจมี่ข่าวดีใน Hyper-V 3 ก็ได้

วิธีการแก้ไขต้องใช้ Tools nvspbind เราสามารถ
download ได้ที่นี่ ขั้นตอนการแก้ไขให้ทำดังนี้

  1. จัดทำทะเบียน Network ให้เรียบร้อย เพื่อป้องกันความผิดพลาดซ้ำซ้อน ใช้ตัวอย่างด้านล่าง

Physical Port

ใช้งานอะไร

Network Connection Name

MAC

Friendly Name

On-Board 1

Management

Local Area Connection

xx-xx-xx-xx-xx-xx

HP NC382i DP Multifunction Gigabit Server Adapter #1

On-Board 2

Application (Team)

Local Area Connection 2

xx-xx-xx-xx-xx-xx

HP NC382i DP Multifunction Gigabit Server Adapter #2

PCI-A

Application (Team)

Local Area Connection 3

xx-xx-xx-xx-xx-xx

HP NC360T PCIe DP Gigabit Server Adapter #1

Team2

Team

Local Area Connection 4

xx-xx-xx-xx-xx-xx

 

 

 

  1. ใช้คำสั่ง c:\>nvspbind ผลเป็นตามด้านล่างสังเกตุตรง Highlight ตัวสีแดง

     

Hyper-V Network VSP Bind Application 6.1.7725.0.

Copyright (c) Microsoft Corporation. All rights reserved.

Adapters:

{2D0E05DE-E2DA-41D4-A81F-F4178AE39EBF}

“cq_cpqteammp”

“Team2”    <- Friendly Name

“Local Area Connection 4”:

disabled: ms_netbios (NetBIOS Interface)

disabled: ms_server (File and Printer Sharing for Microsoft Networks)

disabled: ms_pacer (QoS Packet Scheduler)

disabled: ms_msclient (Client for Microsoft Networks)

disabled: ms_lltdio (Link-Layer Topology Discovery Mapper I/O Driver)

disabled: ms_rspndr (Link-Layer Topology Discovery Responder)

disabled: ms_tcpip6 (Internet Protocol Version 6 (TCP/IPv6))

disabled: ms_netbt (WINS Client(TCP/IP) Protocol)

disabled: ms_smb (Microsoft NetbiosSmb)

disabled: ms_tcpip (Internet Protocol Version 4 (TCP/IPv4))

disabled: cq_cpqteam (HP Network Configuration Utility)


enabled: vms_pp (Microsoft Virtual Network Switch Protocol)

<-
มีปัญหาตรงนี้จุดที่ 1

 

{CAFD2418-32EF-4F64-B4E8-A3B155595587}

“b06bdrv\l2nd&pci_163914e4”

“HP NC382i DP Multifunction Gigabit Server Adapter #2”

“Brd-2”:

disabled: ms_netbios (NetBIOS Interface)

disabled: ms_server (File and Printer Sharing for Microsoft Networks)

disabled: ms_pacer (QoS Packet Scheduler)

disabled: ms_msclient (Client for Microsoft Networks)

disabled: ms_lltdio (Link-Layer Topology Discovery Mapper I/O Driver)

disabled: ms_rspndr (Link-Layer Topology Discovery Responder)

disabled: ms_tcpip6 (Internet Protocol Version 6 (TCP/IPv6))

disabled: ms_netbt (WINS Client(TCP/IP) Protocol)

disabled: ms_smb (Microsoft NetbiosSmb)

disabled: ms_tcpip (Internet Protocol Version 4 (TCP/IPv4))

enabled: cq_cpqteam (HP Network Configuration Utility)


disabled: vms_pp (Microsoft Virtual Network Switch Protocol)

 

{7005F7AD-0DB5-47F2-A302-FAE517BE56D0}

“pci\ven_8086&dev_105e”

“HP NC360T PCIe DP Gigabit Server Adapter”    <- Friendly Name

“Local Area Connection”:

disabled: ms_netbios (NetBIOS Interface)

disabled: ms_server (File and Printer Sharing for Microsoft Networks)

disabled: ms_pacer (QoS Packet Scheduler)

disabled: ms_msclient (Client for Microsoft Networks)

disabled: ms_lltdio (Link-Layer Topology Discovery Mapper I/O Driver)

disabled: ms_rspndr (Link-Layer Topology Discovery Responder)

disabled: ms_tcpip6 (Internet Protocol Version 6 (TCP/IPv6))

disabled: ms_netbt (WINS Client(TCP/IP) Protocol)

disabled: ms_smb (Microsoft NetbiosSmb)

disabled: ms_tcpip (Internet Protocol Version 4 (TCP/IPv4))

disabled: cq_cpqteam (HP Network Configuration Utility)


enabled: vms_pp (Microsoft Virtual Network Switch Protocol)
<-
มีปัญหาตรงนี้จุดที่ 2

cleaning up…finished (0)

 

  1. ใช้คำสั่ง nvspbind /u “friend name” (ดูเขียวๆ จาก result ที่ capture มาด้านบน) ด้านล่างเพื่อ disable
    Microsoft virtual network switch

     

    c:\>nvspbind /u “HP NC360T PCIe DP Gigabit Server Adapter”

    c:\>nvspbind /u “Team2”

 

เมื่อแก้เสร็จตาม 1-3 การสร้าง Virtual Network ก็จะทำได้

 

สรุป

การทำงานกับ Hyper-V เราควรมีการวางแผนและเตรียมทุกอย่างก่อนลงมือทำ อย่างปัญหาในตอนนี้เกิดจากมี NIC อันหนึ่งเคยถูกใช้เป็น Virtual Network แล้วต่อมาภายหลังไปสร้าง Team แล้วรวม NIC อันนี้ไปด้วยจึงมีปัญหา

 

Reference

  1. Knowledge base ของ Microsoft ที่แสดงวิธีแก้ไขปัญหา
    http://support.microsoft.com/kb/2486812 \
  2. เครื่องมือ nvspbind ที่ใช้แก้ปัญหา

เมื่อ Trend-Micro ทำให้ virtual configuration file corrupt

เกิดเหตุการณ์ได้รับแจ้งว่าเครื่อง Virtual Machine หายไปจากหน้าจอ Hyper-V Manager หลังจากที่ Reboot ตัว host server เมื่อไล่เรียงลำดับเหตุการณ์และสภาพแวดล้อมที่มีปัญหา จึงสรุปได้เรื่องราวได้ดังนี้

  • ตามล่า Configuration file ว่าชื่ออะไรหรืออยู่ที่ไหน เพื่อจะได้ไปตรวจสอบว่ามันยังอยู่หรือไม่
  1.  ตามปกติมันจะอยู่ใน folder -> c:\programdata\microsoft\windows\hyper-v\virtual machine
  • copy file ไปเปิดใน Internet Explorer บนเครื่องอื่น เพื่อดูว่า xml format เรียบร้อยดี
  • ถ้ามี anti-virus ให้ uninstall หรือ ปิดไปก่อน
  • ถ้ามี admin หลายคนก็
  • สาเหตุของปัญหาในครั้งนี้คือ configuration file ที่มี extension .xml ตรงบรรทัดสุดท้าย </configration> มีเครื่องหมาย > สองครั้ง (“>>”) จึงทำให้ระบบอ่านไฟล์นี้ไม่ได้ การแก้ไขก็ให้ backup file นี้เก็บไว้ก่อน แล้วเปิดด้วย notepad เพื่อลบ “>” ตัวที่เกิดมา หลังจากนั้น reboot ตัว host server อีกทีระบบก็กลับมาใช้ได้เหมือนเดืม
  • ประสบการณ์ที่ได้จากครั้งนี้
  1. ถ้าจะลง Anti-virus บนเครื่อง Hyper-v ต้อง exclude path ตามที่ Microsoft แนะนำไว้ตาม link นี้ Planning for Hyper-V Security
  2. สำหรับ Trend อ่านเรื่องนี้ Does OfficeScan 10 support Windows Server 2008 Hyper-V?
  3. ควร backup configuration file เก็บไว้ใช้ในกรณีที่มีเสียหาย
  4. การทำ Snapshot ใน hyper-v ไม่ควรทำไว้หลาย version บนระบบ production ไม่ดี เพราะเปลืองเนื้อที่และหากมีปัญหาทำให้แก้ไขยากโดยไม่มีความจำเป็น
  5. อีกเรื่องคือถ้ามี snapshot ใน configuration file ที่ตัว disk ที่เป็นชื่อของ snapshot ที่มี extension .avhd
  6. หลักจากลบ snapshot ตอนจะ boot เครื่อง Hyper-V ต้องทำการ Merge ซึ่งจะเห้น Status เป็น Merge in Progress (xx %)
  7. จากข้อ 5 และเคยทำการ expand disk มาก่อนนี้ทำให้ทราบว่า hyper-v เมื่อรับคำสั่งแล้วมันจะทำงานให้ใน background ดังนั้น ควรดู status ให้ดีและอย่าใจร้อน
  8. Windows นำระบบ symbolic link มาใช้กับ configuration file คำสั่ง mklink และถ้าจะลบ link ก็ del ตามปกติ มันจะไม่ลบ file ที่เก็บตัวจริง

Reference

1.  Planning for Hyper-V Security

2. Does OfficeScan 10 support Windows Server 2008 Hyper-V?

3. MkLink

 

รับให้คำปรึกษา ออกแบบ วางระบบ Server Virtualization ด้วย Microsoft Hyper-V

สำหรับการใช้งานเครื่อง computer สำหรับบุคคลหรือหน่วยงานต่างๆ อาจต้องการเครื่องที่มีขนาดใหญ่ว่า computer ส่วนบุคคลทั่วไป ที่เราเรียกว่า Server เครื่องแบบนี้จำเป็นต้องมีการดูแลที่เหมาะสม เริ่มตั้งแต่คิดให้ดีก่อนว่าจะซื้อแบบใด เพื่อวัตถุประสงค์อะไร ซึ่งปัจจุบันเครื่องราคาไม่แพงแต่ก็มีประสิทธิภาพสูง และการสูงเกินความจำเป็นจึงทำให้การใช้งานไม่คุ้มค่า ดังนั้นปัจจัยเรื่องการดูแลและค่าใช้จ่ายจึงเป็นตัวกระตุ้นให้หลายๆ หน่วยงานหันมาใช้ระบบที่เรียกว่า Virtual Server กันมากขึ้น ซึ่งรายละเอียดจะได้นำเสนอผ่าน vm360degree blog แห่งนี้ในอนาคต  ตัวอย่างเรื่องที่จะนำเสนอได้แก่ Hyper-V คืออะไร, อยากใช้ Hyper-V, Virtualization คืออะไร, Virtualization เริ่มต้นอย่างไร, อยากทำ Virtual Server ไม่รู้จะปรึกษาใคร หรือ Cloud Computing คืออะไร, Thai Hyper-V มีไหม และอีกเรื่องคือ Power Shell เป็นต้น

ผมมีประสบการณ์ติดตั้งและใช้งานระบบ Virtual Server ของ Microsoft ที่เรียกว่า Microsoft Hyper-V ตั้งแต่ version แรกคือ 2008 อยากเสนอตัวให้บริการแบบไม่หากำไร หากหน่วยงานใดที่มีปัญหาข้อสงสัยต้องการคำแนะนำ สามารถติดต่อได้ทาง e-mail ที่ chaba_ok@yahoo.com การเสนอให้ความช่วยเหลือ ขอพิจารณาตามความเหมาะสมและโอกาสครับ