この節では、ldm list-constraints -x primary コマンドの標準的なの XML 出力を、primary ドメインの再構成に必要な CLI コマンドに変換する方法について説明します。XML 出力のサンプルでは、XML から CLI コマンドを作成するために使用するリソースおよびプロパティーが太字で示されています。CLI コマンドの詳細は、ldm(1M) マニュアルページを参照してください。
ldm list-constraints -x primary コマンドの出力のサンプルを次に示します。
<?xml version="1.0"?> <LDM_interface version="1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schemas/combined-v3.xsd" xmlns:ovf="./schemas/envelope" xmlns:rasd="./schemas/CIM_ResourceAllocationSettingData" xmlns:vssd="./schemas/CIM_VirtualSystemSettingData" xmlns:gprop="./schemas/GenericProperty" xmlns:bind="./schemas/Binding"> <data version="3.0"> <Envelope> <References/> <Content xsi:type="ovf:VirtualSystem_Type" ovf:id="primary"> <Section xsi:type="ovf:ResourceAllocationSection_Type"> <Item> <rasd:OtherResourceType>ldom_info</rasd:OtherResourceType> <rasd:Address>00:03:ba:d8:ba:f6</rasd:Address> <gprop:GenericProperty key="hostid">0x83d8baf6</gprop:GenericProperty> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>cpu</rasd:OtherResourceType> <rasd:AllocationUnits>4</rasd:AllocationUnits> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>mau</rasd:OtherResourceType> <rasd:AllocationUnits>1</rasd:AllocationUnits> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>memory</rasd:OtherResourceType> <rasd:AllocationUnits>4G</rasd:AllocationUnits> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>physio_device</rasd:OtherResourceType> <gprop:GenericProperty key="name">pci@7c0</gprop:GenericProperty> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vsw</rasd:OtherResourceType> <rasd:Address>auto-allocated</rasd:Address> <gprop:GenericProperty key="service_name">primary-vsw0</gprop:GenericProperty> <gprop:GenericProperty key="dev_path">nxge0</gprop:GenericProperty> <gprop:GenericProperty key="default-vlan-id">1</gprop:GenericProperty> <gprop:GenericProperty key="pvid">1</gprop:GenericProperty> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vcc</rasd:OtherResourceType> <gprop:GenericProperty key="service_name">primary-vcc0</gprop:GenericProperty> <gprop:GenericProperty key="min_port">5000</gprop:GenericProperty> <gprop:GenericProperty key="max_port">6000</gprop:GenericProperty> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vds</rasd:OtherResourceType> <gprop:GenericProperty key="service_name">primary-vds0</gprop:GenericProperty> </Item> </Section> <Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vds_volume</rasd:OtherResourceType> <gprop:GenericProperty key="vol_name">primary-vds0-vol0</gprop:GenericProperty> <gprop:GenericProperty key"block_dev">/opt/SUNWldm/domain_disks/testdisk.nv.53.1</gprop:GenericProperty> <gprop:GenericProperty key="service_name">primary-vds0</gprop:GenericProperty> </Item> </Section> </Content> </Envelope> </data> </LDM_interface> |
<Content> タグおよび <Content> タグ内の <Section> には、primary ドメイン、および primary ドメインに含まれるすべてのリソースが記述されています。<Item> 内の <rasd:...> タグおよび <gprop:GenericProperty...> タグには、各リソースに必要なプロパティーが記述されています。各 <Section> の各リソースを確認して、リソースの制約に基づいて CLI コマンドを作成できます。以降の節では、ドメインの XML 記述でより一般的ないくつかのリソースと、そのリソースに対する同等の CLI コマンドを示します。
このセクションには、primary ドメインの MAC アドレスおよびホスト ID の情報が記述されます。これは primary ドメインであるため、この情報を設定することはできません。この情報は自動的に設定されます。
<Section> xsi:type="ovf:ResourceAllocationSection_Type"> <Item> <rasd:OtherResourceType>ldom_info</rasd:OtherResourceType> <rasd:Address>00:03:ba:d8:ba:f6</rasd:Address> <gprop:GenericProperty key="hostid">0x83d8baf6</gprop:GenericProperty> </Item> </Section> |
この例での論理ドメインの情報 (ldom_info) は、次のとおりです。
(MAC) Address - 00:03:ba:d8:ba:f6
hostid - 0x83d8baf6
このセクションには、primary ドメインに割り当てられた暗号化装置 (mau) の数が記述されます。
XML の一覧では mau セクションは cpu セクションのあとに記述されていますが、set-mau サブコマンドは set-cpu サブコマンドの前に実行する必要があります。これは、対応する暗号化装置を削除しないかぎりドメインから CPU を削除できないためです。
<Section> xsi:type="ovf:VirtualHardwareSection_Type" <Item> <rasd:OtherResourceType>mau</rasd:OtherResourceType> <rasd:AllocationUnits>1</rasd:AllocationUnits> </Item> </Section> |
このセクションは、次の CLI コマンドに相当します。
# ldm set-mau 1 primary |
このセクションには、primary ドメインに割り当てられた仮想 cpu の数が記述されます。
<Section> xsi:type="ovf:VirtualHardwareSection_Type" <Item> <rasd:OtherResourceType>cpu</rasd:OtherResourceType> <rasd:AllocationUnits>4</rasd:AllocationUnits> </Item> </Section> |
このセクションは、次の CLI コマンドに相当します。
# ldm set-vcpu 4 primary |
このセクションには、primary ドメインに割り当てられたメモリーの量が記述されます。
<Section> xsi:type="ovf:VirtualHardwareSection_Type" <Item> <rasd:OtherResourceType>memory</rasd:OtherResourceType> <rasd:AllocationUnits>4G</rasd:AllocationUnits> </Item> </Section> |
このセクションは、次の CLI コマンドに相当します。
# ldm set-memory 4G primary |
このセクションには、primary ドメインに残す物理 I/O バスが記述されます。
<Section> xsi:type="ovf:VirtualHardwareSection_Type" <Item> <rasd:OtherResourceType>physio_device</rasd:OtherResourceType> <gprop:GenericProperty key="name">pci@7c0</gprop:GenericProperty> </Item> </Section> |
以前の構成どおりに、同じ I/O デバイスを primary ドメインに設定するには、まず、起動時に構成される I/O デバイスを一覧表示する必要があります。
# ldm list -l primary .... IO DEVICE PSEUDONYM OPTIONS pci@7c0 bus_b pci@780 bus_a .... |
例 10–6 で、primary ドメインに残るように以前に構成されていたバスは、pci@7c0 です。XML に他の physio-device セクションが含まれていない場合、pci@780 バスを削除する必要があります。
このセクションは、次の CLI コマンドに相当します。
# ldm remove-io pci@780 primary |
このセクションには、primary ドメインに割り当てられた仮想スイッチ (vsw) が記述されます。
<Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vsw</rasd:OtherResourceType> <rasd:Address>auto-allocated</rasd:Address> <gprop:GenericProperty key="service_name">primary-vsw0</gprop:GenericProperty> <gprop:GenericProperty key="dev_path">nxge0</gprop:GenericProperty> <gprop:GenericProperty key="mode">sc</gprop:GenericProperty> <gprop:GenericProperty key="default-vlan-id">1</gprop:GenericProperty> <gprop:GenericProperty key="pvid">1</gprop:GenericProperty> </Item> </Section> |
各表記の意味は次のとおりです。
<rasd:Address> タグには、仮想スイッチに使用される MAC アドレスが記述されます。このタグの値が auto-allocated である場合、MAC アドレスを指定する必要はありません。
XML のキープロパティー service_name は、仮想スイッチの名前 (この場合は、primary-vsw0) を示します。
XML のキープロパティー dev_path は、実際のネットワークデバイスのパス名 (この場合は、net-dev=nxge) を示します。
XML のキープロパティー mode は、SunCluster のハートビートサポートのための sc を示します。
default-vlan-id (1)、pvid (1) など、このセクションの一部の値にはデフォルト値が使用されるため、このセクションは次の CLI コマンドに相当します。
# ldm add-vswitch net-dev=nxge primary-vsw0 primary |
このセクションには、primary ドメインに割り当てられた仮想コンソール端末集配信装置 (vcc) が記述されます。
<Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vcc</rasd:OtherResourceType> <gprop:GenericProperty key="service_name">primary-vcc0</gprop:GenericProperty> <gprop:GenericProperty key="min_port">5000</gprop:GenericProperty> <gprop:GenericProperty key="max_port">6000</gprop:GenericProperty> </Item> </Section> |
XML のキープロパティー service_name は、vcc サービスの名前 (この場合は、primary-vcc0) を示します。
このセクションは、次の CLI コマンドに相当します。
# ldm add-vcc port-range=5000-6000 primary-vcc0 primary |
このセクションには、primary ドメインに割り当てられた仮想ディスクサーバー (vds) が記述されます。
<Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vds</rasd:OtherResourceType> <gprop:GenericProperty key="service_name">primary-vds0</gprop:GenericProperty> </Item> </Section> |
XML のキープロパティー service_name は、仮想ディスクサーバーのこのインスタンスのサービス名 (この場合は、primary-vds0) を示します。この service_name は、サーバー上のすべての仮想ディスクサーバーインスタンスの中で一意である必要があります。
このセクションは、次の CLI コマンドに相当します。
# ldm add-vds primary-vds0 primary |
このセクションには、primary ドメインに割り当てられた仮想ディスクサーバーによってエクスポートされたデバイス (vdsdev) が記述されます。
<Section xsi:type="ovf:VirtualHardwareSection_Type"> <Item> <rasd:OtherResourceType>vds_volume</rasd:OtherResourceType> <gprop:GenericProperty key="vol_name">vdsdev0</gprop:GenericProperty> <gprop:GenericProperty key="service_name">primary-vds0</gprop:GenericProperty> <gprop:GenericProperty key="block_dev">/opt/SUNWldm/domain_disks/testdisk1</gprop:GenericProperty> <gprop:GenericProperty key="vol_opts">ro</gprop:GenericProperty> <gprop:GenericProperty key="mpgroup">mpgroup-name</gprop:GenericProperty> </Item> </Section> |
各表記の意味は次のとおりです。
XML のキープロパティーであるボリューム名 (vol_name) とサービス名 (service_name) は、CLI コマンドでは組み合わせて使用します (この場合は、vdsdev0@primary-vds0)。
XML のキープロパティー block_dev は、相当する CLI コマンドでの backend 引数となります。これは、仮想ディスクのデータの格納場所を示し、この場合は、/opt/SUNWldm/domain_disks/testdisk1 となります。
XML の省略可能なキープロパティー vol_opts は、{ro,slice,excl} のように、これらの項目の 1 つ以上がコンマで区切られて、1 つの文字列となっているものです。
XML の省略可能なキープロパティー mpgroup は、マルチパス (フェイルオーバー) グループの名前を示します。
このセクションは、次の CLI コマンドに相当します。
# ldm add-vdsdev options=ro mpgroup=mpgroup-name /opt/SUNWldm/domain_disks/testdisk1 vdsdev0@primary-vds0 |