【轉】 HMC與VIOS對新LPAR提供儲存與網路虛擬化的支援

來源:互聯網
上載者:User

標籤:技術   _id   紅色   相關   ber   unit   擴充   als   tip   

前面的幾篇博文的作業環境都是在IVM下,IVM可以看作是VIOS的一部分,或者是對VIOS功能的一個擴充,一個IVM只能管理1台物理伺服器,而HMC則是一對多。在有HMC來管理物理伺服器的情形下,VIOS中的IVM功能將被屏蔽,其相應的功能將由HMC來接管。

下面是在HMC環境下建立一個新的LPAR的命令:
[email protected]:~> mksyscfg -r lpar -m Server-8231-E2B-SN104A4AR -i "name=dennis,lpar_env=aixlinux,auto_start=1,boot_mode=norm,mem_mode=ded,min_mem=2048,
desired_mem=4096,max_mem=4096,proc_mode=shared,sharing_mode=uncap,uncap_weight=156,
min_procs=1,desired_procs=2,max_procs=2,min_proc_units=0.2,desired_proc_units=0.4,max_proc_units=1.2,
virtual_eth_adapters=10/0/256//0/1,virtual_scsi_adapters=20/client/1//17/1, max_virtual_slots=100"

建立一個虛機(LPAR, logical partition)最關鍵也相對比較麻煩一些的參數就是給LPAR提供網路和存放裝置,也就是上面兩條紅色和藍色標註的部分,關於這兩個參數的具體含義在前面用IVM建立LPAR的博文--通過VIOS實現AIX系統的網路虛擬化 和 通過VMLibrary在client partition上安裝AIX全程實錄 。

這裡比較關心的是如何構造該參數的具體數值,首先看網路部分,需要確定的參數是Virtual Ethernet Client Adapter(VECA)在當前正在建立的LPAR中的slot num,這個自由度很高,基本上可以隨便指定一個不超過max_virtual_slots中指定的數值(在我們指定max_virtual_slots參數的情形下),這個例子中VECA的slot number=10, 比較麻煩的是port_vlan_id部分,因為這個數值將直接決定新建立的LPAR中網路裝置是否可用,因此需要將它指定到VIOS中一個物理可用的網路裝置上,所以我們需要在HMC環境(不是IVM了,因為在有HMC存在的情形下,HMC將屏蔽掉VIOS中的IVM命令,屏蔽意味著該條命令可以在VIOS環境下執行,但是do nothing,沒有任何輸出)下查看它的網路裝置相關的資訊。執行:



顯示了當前VIOS中Virtual Ethernet Server Adapter(VESA)的資訊:它有兩個VESA, slot number分別是30和31, addl_vlan_ids=354,355,356和 addl_vlan_ids=330,331,332,333,如果在VIOS中通過lsmap -all -net命令查看,這兩個VESA都有對應的SEA和backing device,因此都可以被client partition拿來使用。

對於VIOS中Virtual SCSI Server Adapter裝置的資訊,可以在HMC下用以下命令來查看:


其中slot number = 17的VSSA正好是我們建立這個LPAR使用的,在上述的mksyscfg命令列中,我們只是建立了一個Virtual SCSI Client Adapter。這條命令執行後,與IVM中mksyscfg命令的執行效果不同,HMC不會在VIOS中自動建立一個對應的Virtual SCSI Server Adapter虛擬設備(比如vhost0)出來,此時需要通過下面這樣的命令給VIOS partition建立一個Virtual SCSI Server Adapter虛擬設備:
[email protected]:~> chhwres -r virtualio --rsubtype scsi -m Server-8231-E2B-SN104A4AR -o a --id 1 -s 18 -a "adapter_type=server, remote_lpar_id=2, remote_slot_num=30"
當然如果我們不想指定remote_lpar的相關資訊,那麼完全可以使用上述命令的一個簡化版本:
[email protected]:~> chhwres -r virtualio --rsubtype scsi -m Server-8231-E2B-SN104A4AR -o a --id 1 -s 18 -a "adapter_type=server"
上面的這條命令只是說在VIOS中建立一個slot num=18的Virtual SCSI Server Adapter, 並沒有指定能使用
該VSSA的client partition的相關資訊,這意味著這個VSSA可以跟Any Partition的Any Partition Slot進行綁定,不過對於Client Adapter的話,則必須指定remote_lpar_id和remote_slot_num兩個參數。當然,如果VIOS中對應slot num=18已經有一個VSSA,則該條命令會提示如下的錯誤:
HSCL294C Dynamic add of virtual I/O resources failed:
A Virtual I/O device already exists at slot 18.

如果VIOS中對應slot num=18尚沒有一個VSSA存在,那麼上述命令就會在VIOS中建立一個VSSA出來,如果想在VIOS中看到該hwres所對應的虛擬設備vhost n,需要登入到VIOS系統中,運行cfgdev命令vios才可自動建立出一個vhostx裝置出來,否則的話只能通過lshwres命令來查看當前VIOS中擁有多少個VSSA:
[email protected]:~> lshwres -r virtualio --rsubtype scsi -m Server-8231-E2B-SN104A4AR --level lpar --filter "lpar_ids=1"
...
lpar_name=vios,lpar_id=1,slot_num=77,state=1,is_required=0,adapter_type=server,
remote_lpar_id=any,remote_lpar_name=,remote_slot_num=any

...

一旦在VIOS中通過cfgdev產生了vhostx虛擬設備,就可以象 通過VMLibrary在client partition上安裝AIX全程實錄 那樣為其建立VTD和backing device.

如果我們考慮一下上述操作的相反的過程,在VIOS環境下,首先必須通過 a. rmvdev -vtd vtdname刪除掉vhostx上的VTD b. 通過rmlv Logical Volume刪除掉backing device(這步需要小心,刪除一個LV,意味這“all data contained on logical volume xxx will be destroyed")c. rmdev -dev vhostx
到目前為止的這幾步還只是刪除vhostx這個虛擬設備,但是在hwres這一層,供過lshwres依然可以看到該vhostx歲對應的hwres還存在著,此時就必須利用chhwres命令來徹底把這一hwres刪除掉。

啟動LPAR並安裝了AIX之後,配置完網路,就可以用比如ssh的方式登入進去。在該AIX環境下,我們執行:
bash-3.2# prtconf
會有以下的輸出:
。。。
System Model: IBM,8231-E2B
Machine Serial Number: 104A4AR
Processor Type: PowerPC_POWER7
Processor Implementation Mode: POWER 7
Processor Version: PV_7_Compat
Number Of Processors: 2
Processor Clock Speed: 3000 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: 2 dennis
Memory Size: 4096 MB
Good Memory Size: 4096 MB
Platform Firmware level: AL730_066
Firmware Version: IBM,AL730_066
Console Login: enable
Auto Restart: true
Full Core: false
。。。
INSTALLED RESOURCE LIST

The following resources are installed on the machine.
+/- = Added or deleted from Resource List.
*   = Diagnostic support not available.
       
  Model Architecture: chrp
  Model Implementation: Multiple Processor, PCI bus
       
+ sys0                                                            System Object
+ sysplanar0                                                      System Planar
* vio0                                                            Virtual I/O Bus
* vscsi0           U8231.E2B.104A4AR-V2-C20-T1                    Virtual SCSI Client Adapter
* hdisk1           U8231.E2B.104A4AR-V2-C20-T1-L8300000000000000  Virtual SCSI Disk Drive
* hdisk0           U8231.E2B.104A4AR-V2-C20-T1-L8200000000000000  Virtual SCSI Disk Drive
* cd0              U8231.E2B.104A4AR-V2-C20-T1-L8100000000000000  Virtual SCSI Optical Served by VIO Server
* ent0             U8231.E2B.104A4AR-V2-C10-T1                    Virtual I/O Ethernet Adapter (l-lan)
* vsa0             U8231.E2B.104A4AR-V2-C0                        LPAR Virtual Serial Adapter
* vty0             U8231.E2B.104A4AR-V2-C0-L0                     Asynchronous Terminal
+ L2cache0                                                        L2 Cache
+ mem0                                                            Memory
+ proc0                                                           Processor
+ proc4                                                           Processor

網友可以與當初建立它的命令列參數進行對比,看看它們之間的那種對應關係。

【轉】 HMC與VIOS對新LPAR提供儲存與網路虛擬化的支援

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.