複数の Lab リソース定義をインポートするためのファイルの作成

リソース定義のリストを XML 形式で作成して、Lab リソース・データを Lab 管理ツールにインポートすることができます。
このタスクについて
リストは、このトピックにある XML 文書テンプレートを使用してテキスト・エディターで作成します。 このテンプレートの使用は、リソース・リストを現行の形式と一致させる上で役に立ちます。 テンプレートには、物理マシンと仮想イメージという 2 つの Lab リソースの定義が含まれています。

Lab リソースのリストを作成するには、次のようにします。

  1. 以下の例の Lab リソース定義コードのセクションをコピーします。
  2. テキスト・エディターを開き、コードのセクションをテキスト文書に貼り付けます。
  3. <assetInstance> セクションで、Lab にあるリソースに対応する値を指定します。 必要に応じて <assetInstance> コード・ブロックを追加します。
  4. ファイルに名前を付けて、.xml ファイル拡張子で保存します。

この例には、物理マシンと仮想イメージの Lab リソース定義が含まれています。 前述の手順に従って、これを Lab リソース・リストを作成するためのビルディング・ブロックとして使用します。
<?xml version="1.0" encoding="UTF-8"?>
<Assets>
    <AssetInstance>
        <AssetType>
            <type>Machine</type>
            <name>Machine</name>
            <Attributes>
                <Attribute name="model" type="StringType">
                    <value>
                        <string>IBM</string>
                    </value>
                </Attribute>
                <Attribute name="Operational Status" type="StringType">
                    <value>
                        <string>Available</string>
                    </value>
                </Attribute>
                <Attribute name="PrimaryMACAddress" type="StringType">
                    <value>
                        <string>00-1D-E0-38-1E-B9</string>
                    </value>
                </Attribute>
                <Attribute name="Notes" type="StringType">
                    <value>
                        <string>This is a sample notes field entry.</string>
                    </value>
                </Attribute>
                <Attribute name="memory" type="NumericType">
                    <value>
                        <int>2048</int>
                    </value>
                </Attribute>
                <Attribute name="operatingsystem" type="ConfigurationPartType">
                    <value>
                        <AssetInstance>
                            <AssetType>
                                <type>OperatingSystem</type>
                                <name>Gentoo 2007.0</name>
                                <Attributes>
                                    <Attribute name="KernelArchitecture" type="StringType">
                                        <value>
                                            <string>x86-32</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Version" type="ConfigurationPartType">
                                        <value>
                                            <AssetInstance>
                                                <AssetType>
                                                    <type>Version</type>
                                                    <name>Version</name>
                                                    <Attributes>
                                                        <Attribute name="MajorVersion" type="NumericType">
                                                            <value>
                                                                <int>2007</int>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="BuildLevel" type="StringType">
                                                            <value>
                                                                <string>0</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="VersionString" type="StringType">
                                                            <value>
                                                                <string>2007.0</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="Modifier" type="NumericType">
                                                            <value>
                                                                <int>0</int>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="Level" type="NumericType">
                                                            <value>
                                                                <int>0</int>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="Release" type="NumericType">
                                                            <value>
                                                                <int>2007</int>
                                                            </value>
                                                        </Attribute>
                                                    </Attributes>
                                                </AssetType>
                                            </AssetInstance>
                                        </value>
                                    </Attribute>
                                    <Attribute name="FullyQualifiedDomainName" type="StringType">
                                        <value>
                                            <string>SampleMachine.sample.com</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Locale" type="StringType">
                                        <value>
                                            <string>en_US.UTF-8</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="TimeZone" type="StringType">
                                        <value>
                                            <string>GMT Greenwich Mean Time Europe UTC</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="hostname" type="StringType">
                                        <value>
                                            <string>SampleMachine</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="KernelWidth" type="StringType">
                                        <value>
                                            <string>32 bit</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Distribution" type="StringType">
                                        <value>
                                            <string>Gentoo</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Type" type="StringType">
                                        <value>
                                            <string>sample type</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="KernelVersion" type="StringType">
                                        <value>
                                            <string>2.6.23</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Manufacturer" type="StringType">
                                        <value>
                                            <string>Gentoo</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="SoftwareInstall" type="ConfigurationPartType">
                                        <value>
                                            <AssetInstance>
                                                <AssetType>
                                                    <type>SoftwareInstall</type>
                                                    <name>Firefox 2.0</name>
                                                    <Attributes>
                                                        <Attribute name="InstalledLocation" type="StringType">
                                                            <value>
                                                                <string>/usr/bin</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="DisplayName" type="StringType">
                                                            <value>
                                                                <string>Firefox</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="Version" type="ConfigurationPartType">
                                                            <value>
                                                                <AssetInstance>
                                                                    <AssetType>
                                                                        <type>Version</type>
                                                                        <name>Version</name>
                                                                        <Attributes>
                                                                            <Attribute name="MajorVersion" type="NumericType">
                                                                                <value>
                                                                                    <int>2</int>
                                                                                </value>
                                                                            </Attribute>
                                                                            <Attribute name="BuildLevel" type="StringType">
                                                                                <value>
                                                                                    <string>0</string>
                                                                                </value>
                                                                            </Attribute>
                                                                            <Attribute name="VersionString" type="StringType">
                                                                                <value>
                                                                                    <string>2.0.0.12</string>
                                                                                </value>
                                                                            </Attribute>
                                                                            <Attribute name="Modifier" type="NumericType">
                                                                                <value>
                                                                                    <int>2</int>
                                                                                </value>
                                                                            </Attribute>
                                                                            <Attribute name="Level" type="NumericType">
                                                                                <value>
                                                                                    <int>0</int>
                                                                                </value>
                                                                            </Attribute>
                                                                            <Attribute name="Release" type="NumericType">
                                                                                <value>
                                                                                    <int>2</int>
                                                                                </value>
                                                                            </Attribute>
                                                                        </Attributes>
                                                                    </AssetType>
                                                                </AssetInstance>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="ProductName" type="StringType">
                                                            <value>
                                                                <string>Firefox</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="ProductID" type="StringType">
                                                            <value>
                                                                <string>Firefox</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="InstalledDate" type="TimeStampType">
                                                            <value>
                                                                <timestamp>-9999</timestamp>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="Description" type="StringType">
                                                            <value>
                                                                <string>Firefox Web Browser</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="Manufacturer" type="StringType">
                                                            <value>
                                                                <string>Mozilla</string>
                                                            </value>
                                                        </Attribute>
                                                        <Attribute name="executableName" type="StringType">
                                                            <value>
                                                                <string>/usr/bin/firefox</string>
                                                            </value>
                                                        </Attribute>
                                                    </Attributes>
                                                </AssetType>
                                            </AssetInstance>
                                        </value>
                                    </Attribute>
                                </Attributes>
                            </AssetType>
                        </AssetInstance>
                    </value>
                </Attribute>
                <Attribute name="L2Interface" type="ConfigurationPartType">
                    <value>
                        <AssetInstance>
                            <AssetType>
                                <type>L2Interface</type>
                                <name>L2Interface</name>
                                <Attributes>
                                    <Attribute name="Loopback" type="StringType">
                                        <value>
                                            <string>sample loopback data</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="HwAddress" type="StringType">
                                        <value>
                                            <string>00-1D-E0-38-1E-A0</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="MTU" type="NumericType">
                                        <value>
                                            <int>100</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Speed" type="NumericType">
                                        <value>
                                            <int>1024</int>
                                        </value>
                                    </Attribute>
                                </Attributes>
                            </AssetType>
                        </AssetInstance>
                    </value>
                </Attribute>
                <Attribute name="cpu" type="ConfigurationPartType">
                    <value>
                        <AssetInstance>
                            <AssetType>
                                <type>CPU</type>
                                <name>x86-32</name>
                                <Attributes>
                                    <Attribute name="cpuArchitecture" type="StringType">
                                        <value>
                                            <string>x86-32</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="cpuArchitectureWidth" type="StringType">
                                        <value>
                                            <string>32 bit</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="cpuManufacturer" type="StringType">
                                        <value>
                                            <string>Intel</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="cpuCoresInstalled" type="NumericType">
                                        <value>
                                            <int>2</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="cpuDiesInstalled" type="NumericType">
                                        <value>
                                            <int>4</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="cpuSpeed" type="NumericType">
                                        <value>
                                            <int>2048</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="cpuCount" type="NumericType">
                                        <value>
                                            <int>1</int>
                                        </value>
                                    </Attribute>
                                </Attributes>
                            </AssetType>
                        </AssetInstance>
                    </value>
                </Attribute>
                <Attribute name="Administrative Status" type="StringType">
                    <value>
                        <string>Enabled</string>
                    </value>
                </Attribute>
                <Attribute name="Description" type="StringType">
                    <value>
                        <string>A sample machine that demonstrates the XML-based asset import mechanism</string>
                    </value>
                </Attribute>
                <Attribute name="ipAddress" type="StringType">
                    <value>
                        <string>192.168.0.1</string>
                    </value>
                </Attribute>
                <Attribute name="name" type="StringType">
                    <value>
                        <string>SampleMachine</string>
                    </value>
                </Attribute>
                <Attribute name="Manufacturer" type="StringType">
                    <value>
                        <string>Sample.com</string>
                    </value>
                </Attribute>
                <Attribute name="SerialNumber" type="StringType">
                    <value>
                        <string>67890</string>
                    </value>
                </Attribute>
                <Attribute name="FreeDiskSpace" type="NumericType">
                    <value>
                        <int>20480</int>
                    </value>
                </Attribute>
                <Attribute name="SystemBuildUUID" type="StringType">
                    <value>
                        <string>_dnhTYRfLEd2p2Lrz1ZL6xg</string>
                    </value>
                </Attribute>
                <Attribute name="ModelNumber" type="StringType">
                    <value>
                        <string>12345</string>
                    </value>
                </Attribute>
                <Attribute name="SystemID" type="StringType">
                    <value>
                        <string>23</string>
                    </value>
                </Attribute>
                <Attribute name="TotalDiskSize" type="NumericType">
                    <value>
                        <int>40960</int>
                    </value>
                </Attribute>
            </Attributes>
        </AssetType>
    </AssetInstance>
    <AssetInstance>
        <AssetType>
            <type>VirtualImage</type>
            <name>VirtualImage</name>
            <Attributes>
                <Attribute name="Version" type="ConfigurationPartType">
                    <value>
                        <AssetInstance>
                            <AssetType>
                                <type>Version</type>
                                <name>Version</name>
                                <Attributes>
                                    <Attribute name="MajorVersion" type="NumericType">
                                        <value>
                                            <int>2</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="BuildLevel" type="StringType">
                                        <value>
                                            <string>0</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="VersionString" type="StringType">
                                        <value>
                                            <string>2.0.0.1</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Modifier" type="NumericType">
                                        <value>
                                            <int>1</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Level" type="NumericType">
                                        <value>
                                            <int>0</int>
                                        </value>
                                    </Attribute>
                                    <Attribute name="Release" type="NumericType">
                                        <value>
                                            <int>2</int>
                                        </value>
                                    </Attribute>
                                </Attributes>
                            </AssetType>
                        </AssetInstance>
                    </value>
                </Attribute>
                <Attribute name="CreatedWithVMTool" type="StringType">
                    <value>
                        <string>VMWare</string>
                    </value>
                </Attribute>
                <Attribute name="DateLastModified" type="TimeStampType">
                    <value>
                        <timestamp>-9999</timestamp>
                    </value>
                </Attribute>
                <Attribute name="name" type="StringType">
                    <value>
                        <string>SampleVirtualImage</string>
                    </value>
                </Attribute>
                <Attribute name="Notes" type="StringType">
                    <value>
                        <string>This is a sample notes field.</string>
                    </value>
                </Attribute>
                <Attribute name="operatingsystem" type="ConfigurationPartType">
                    <value>
                        <AssetInstance>
                            <AssetType>
                                <type>OperatingSystem</type>
                                <name>Windows XP Professional</name>
                                <Attributes>
                                    <Attribute name="KernelArchitecture" type="StringType">
                                        <value>
                                            <string>x86-32</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="FullyQualifiedDomainName" type="StringType">
                                        <value>
                                            <string>SampleVirtualImage.sample.com</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="TimeZone" type="StringType">
                                        <value>
                                            <string>EDT Eastern Daylight Time North America UTC - 4 hours</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="hostname" type="StringType">
                                        <value>
                                            <string>SampleVirtualImage</string>
                                        </value>
                                    </Attribute>
                                    <Attribute name="KernelWidth" type="StringType">
                                        <value>
                                            <string>32 bit</string>
                                        </value>
                                    </Attribute>
                                </Attributes>
                            </AssetType>
                        </AssetInstance>
                    </value>
                </Attribute>
                <Attribute name="DateCreated" type="TimeStampType">
                    <value>
                        <timestamp>-9999</timestamp>
                    </value>
                </Attribute>
                <Attribute name="ImageType" type="StringType">
                    <value>
                        <string>VMware</string>
                    </value>
                </Attribute>
                <Attribute name="Description" type="StringType">
                    <value>
                        <string>A sample virtual image that demonstrates the XML-based asset import mechanism</string>
                    </value>
                </Attribute>
            </Attributes>
        </AssetType>
    </AssetInstance>
</Assets>
次のタスク
Lab リソース・リストを作成した後、Lab マネージャーにインポートし、Lab リソースを検索して、Lab リソースの詳細を表示することができます。

フィードバック