2014/01/24

VMware vCenter 5.1 Resource Pool

虛擬機器會依照預先配置硬體運作,當SQL Server和Hadoop以及FTP Server同時在線上運作,透過Resource Pool來分配好資源,將高優先權資源分配給SQL Server和Hadoop,而低優先權資料則分配給FTP Server


在本篇文章會以CentOS、Fedora17和Ubuntu Server 12來作示範,皆是最小安裝的版本,用圖形介面的朋友要自行調整一些細部設定


首先,在Host上點右鍵,建立Resource Pool


Resource Pool的設定:

  • Name:名稱
  • Shares:資源多寡,你可以設定該區域佔有比例或資源數量
  • Reservation:預留擴展資源,讓虛擬機器能夠有彈性擴展資源
  • Expandable Reservation:是否預留資源讓虛擬機器能彈性擴展
  • Limit:最多分配多少資源限制
  • Unlimited:沒有資源限制


Memory Resouces調整一下,取消Unlimted、Reservation預留100MB和勾選Expandable Reservation並將Limit調整成512MB



Resource Pool建立完成,會看到圓餅圖小圖示出現,機器都先挪到Resource Pool



對Resource Pool內的機器RAM設定為512,並開機


開機完點到test,透過Summary得知目前佔用記憶體為443MB




再把所有虛擬機器關機,並更改Resource Pool的設定,Memory Limit從512MB改為256MB,其它維持原樣


將三台機器一一起動,開到Ubuntu Server的時候會出現錯誤訊息


錯誤是指出資源不足以分配給Ubuntu Server
按下Close之後,Resource Pool會自動幫你擴展Memory,在啟動一次Ubuntu Server就可以開機


觀察test的Summary,記憶體明顯比剛剛少許多



Resource Pool內能還能夠包含Resource Pool,在test內新增一個名為test_child的Resource Pool


test_child能夠分配的資源會由test這個老爸決定
將test這個父Resource Pool的Memory Expandable Reservation取消,Reservation設定為100MB


再回來看子Resource Pool的Memory設定會有什麼影響,這時候的子Memory Limit為256MB,Reservation Limit為100MB,我們試著在將三台機器開機起來看會發生什麼事情?


CentOS開機正常

而Fedora17和Ubuntu Server開機時,會出現錯誤


此時只要將父Resource Pool的記憶體增大,就可以將Fedora17和Ubuntu Server順利開機

由此LAB得知,要作擴展時必須準備1倍以上的硬體才有能力作擴展,並透過Resource Pool來妥善將資源分配完整和優先資源調配,降低資源分配不均的問題



參考資料:
http://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.resourcemanagement.doc_41/getting_started_with_resource_management/c_virtual_machine_resource_allocation_tab.html
http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.resmgmt.doc_50/GUID-AA95D1D1-55C0-419D-9E1A-C523C138CC65.html
http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.resmgmt.doc_50/GUID-3BD591CC-F685-4843-A46E-836B33E91B3E.html
http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.resmgmt.doc_50/GUID-56995443-129D-42CE-AC17-8FB91E55F42F.html
http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.resmgmt.doc_50/GUID-0A910DD0-C75B-46BA-AEC4-7C4B1641C93F.html
http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.resmgmt.doc_50/GUID-727A88F2-D1C4-4AAE-8261-C75A1EA4A97A.html
http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.resmgmt.doc_50/GUID-FC2AA398-7AB0-47B8-B375-44B626C5DAD3.html