このセクションでは、次の Oracle VM Server for SPARC テンプレートタスクの例を示します。
次の ovmtcreate コマンドは、ovmtcreate_example という名前の ldg1 ドメインに基づいたテンプレートを作成します。結果として得られるテンプレート名には .ova の接尾辞が付くことに注意してください。
# ovmtcreate -d ldg1 -o ovmtcreate_example Oracle Virtual Machine for SPARC Template Creation Utility ovmtcreate Version: 3.3.0.0.12 Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. STAGE 1 - EXAMINING SYSTEM AND ENVIRONMENT ------------------------------------------- Performing platform & prerequisite checks Checking user permissions Checking for required packages Checking for required services Checking directory permissions STAGE 2 - ANALYZING DOMAIN --------------------------- Retrieving and processing attributes Checking domain state Getting domain resource settings Discovering network topology Discovering disk topology STAGE 3 - ARCHIVE CREATION --------------------------- Checking destination and current directory capacity Compressing disk image Creating XML configuration Calculating manifest checksums Creating archive file Checking archive PROCESS COMPLETED ------------------ Started: Tue Aug 18 15:29:14 PDT 2015 Completed: Tue Aug 18 15:41:25 PDT 2015 Elapsed time: 0:12:11使用例 18-2 Oracle VM Server for SPARC テンプレートのプロパティーの構成
ovmtconfig および ovmtprop ユーティリティーを使用すると、それぞれ Oracle VM Server for SPARC テンプレートのプロパティー値と Oracle Solaris OS のプロパティー値を指定できます。
次の ovmtconfig コマンドは、ldg1 ドメインのファイルシステムに対して直接、構成操作を実行します。
–c オプションは、プロパティー値を設定するための /opt/ovmtutils/share/scripts/ovmt_s11_scprofile.sh スクリプトを指定します。–p オプションは、com.oracle.solaris.network.ipaddr および com.oracle.solaris.system.computer-name プロパティーの特定の値を指定します。
# ovmtconfig -v -d ldg1 -f -s \ -c /opt/ovmtutils/share/scripts/ovmt_s11_scprofile.sh \ -p com.oracle.solaris.network.ipaddr.0=10.153.118.211,\ com.oracle.solaris.system.computer-name=system1 Oracle Virtual Machine for SPARC Configuration Utility ovmtconfig Version: 3.3.0.0.12 Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. STAGE 1/7 - EXAMINING SYSTEM AND ENVIRONMENT -------------------------------- Checking operating system Checking platform type Checking user permissions Checking packages Checking host domain name Checking host domain type Checking services STAGE 2/7 - PROCESSING COMMAND LINE OPTIONS ------------------------------- Parsing individual properties Creating consolidated properties list STAGE 3/7 - ANALYZING TARGET DOMAIN ----------------------- Stopping domain ldg1 Analyzing domain disk topology for domain ldg1 Discovering 1 volumes for vDisks Examining 1 backend devices unbinding domain ldg1 Creating 1 virtual disks for back mount Created virtual disk 0 STAGE 4/7 - PERFORMING BACKMOUNT -------------------- Finding Solaris device for vdisks Importing zpools for 1 Solaris devices Detected conflicting zpool name, attempting rename Getting boot file system for properties in 1 zpool Setting properties in 1 zpools Mounting ZFS file systems Mounting ZFS found in zpool rpool_1 STAGE 5/7 - PERFORMING ACTIONS ON TARGET DOMAIN ----------------------------------- STAGE 6/7 - UNMOUNTING AND RESTORING DOMAIN STATE ------------------------------------- Rolling back commands DEBUG [20150819-07:02:42]: Rolling back 8 /usr/sbin/zfs unmount -f rpool_1/ROOT/solaris/var completed STAGE 7/7 - SETTING TARGET DOMAIN ENVIRONMENT --------------------------------- Checking 2 properties to set as domain variables /opt/ovmtutils/bin/agent/lib/ldoms/ldmxml.py:1692: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. if outgoing: .. Starting domain Process completed
次の ovmtprop コマンドは、Oracle Solaris OS のプロパティー値を指定します。
# ovmtprop set-prop com.oracle.solaris.system.computer-name=test ldg1 Oracle Virtual Machine for SPARC Properties Utility ovmtprop Version: 3.3.0.0.12 Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. /opt/ovmtutils/bin/agent/lib/ldoms/ldmxml.py:1692: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead. if outgoing: solaris property set via VM-API
com.oracle.solaris.system.computer-name プロパティーの値が test であることを確認するには、ldm list -l コマンドを使用します。
# ldm ls -l ldg1 NAME STATE FLAGS CONS VCPU MEMORY UTIL NORM UPTIME ldg1 active -n---- 5000 16 16G 0.0% 0.0% 2h 7m .. CONSTRAINT VARIABLES auto-boot?=true VMAPI TO GUEST com.oracle.solaris.fmri.count=0 com.oracle.solaris.system.computer-name=test
次の ovmtdeploy コマンドは、/export/ovmtdeploy ディレクトリ内の ovmtcreate_example.ova Oracle VM Server for SPARC テンプレートを使用して、ldg1 という名前のドメインを作成します。
# ovmtdeploy -d ldg1 -o /export/ovmtdeploy ovmtcreate_example.ova Oracle Virtual Machine for SPARC Deployment Utility ovmtdeploy Version 3.3.0.0.12 Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. STAGE 1 - EXAMINING SYSTEM AND ENVIRONMENT ------------------------------------------ Checking user privilege Performing platform & prerequisite checks Checking for required services Named resourced available STAGE 2 - ANALYZING ARCHIVE & RESOURCE REQUIREMENTS --------------------------------------------------- Checking .ova format and contents Validating archive configuration Checking sufficient resources present WARNING: Virtual switch primary-vsw0 already exists STAGE 3 - EXTRACTING ARCHIVE ---------------------------- Extracting archive Validating checksums Decompressing disk image(s) STAGE 4 - DEPLOYING DOMAIN -------------------------- Creating domain and adding resources Validating deployment Domain created:
ldm list の出力は、ldg1 という名前の新しいドメインが作成されたことを示しています。
# ldm list NAME STATE FLAGS CONS VCPU MEMORY UTIL NORM UPTIME primary active -n-cv- UART 8 40G 1.4% 1.1% 6d 2h 18m ldg1 active -n---- 5000 8 8G 41% 38% 28s使用例 18-4 Oracle VM Server for SPARC テンプレートライブラリの管理
ovmtlibrary コマンドは、ファイルを構成し、データベース内の情報を格納、取得、および編集することによって、Oracle VM Server for SPARC テンプレート のためのデータベースおよびファイルシステムベースのリポジトリを管理します。
次のコマンドは、export/user1/ovmtlibrary_example 内にテンプレートライブラリを作成します。
# ovmtlibrary -c init -l /export/user1/ovmtlibrary_example Oracle Virtual Machine for SPARC Template Library Utility ovmtlibrary Version: 3.3.0.0.12 Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. Init complete
次のコマンドは、sol-11_2-ovm-2-sparc.ova テンプレートを export/user1/ovmtlibrary_example ライブラリ内に格納します。
# ovmtlibrary -c store -d "ovmtlibrary example" -o http://system1.example.com/s11.2/templates/sol-11_2-ovm-2-sparc.ova -l /export/user1/ovmtlibrary_example Oracle Virtual Machine for SPARC Template Library Utility ovmtlibrary Version: 3.3.0.0.12 Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. Templates present in path "/export/user1/ovmtlibrary_example" event id is 2 ******************************************************************************** converted 'http://system1.example.com/s11.2/templates/sol-11_2-ovm-2-sparc.ova' (646) -> 'http://system1.example.com/s11.2/templates/sol-11_2-ovm-2-sparc.ova' (UTF-8) --2015-08-18 16:37:17-- http://system1.example.com/s11.2/templates/sol-11_2-ovm-2-sparc.ova Resolving system1.example.com (system1.example.com)... 10.134.127.18 Connecting to system1.example.com (system1.example.com)|10.134.127.18|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1018341888 (971M) [text/plain] Saving to: '/export/user1/ovmtlibrary_example/repository/templates/1/1/sol-11_2-ovm-2-sparc.ova' /export/user1/ovmtlibrary_example/repo 100% [==============================================================================>] 971.17M 6.05MB/s in 5m 37s 2015-08-18 16:42:55 (2.88 MB/s) - '/export/user1/ovmtlibrary_example/repository/templates/1/1/sol-11_2-ovm-2-sparc.ova' saved [1018341888/1018341888] ******************************************************************************** Download complete Extracting the ova file... Extract complete Decompress file System.img.gz Store complete
次のコマンドは、export/user1/ovmtlibrary_example ライブラリの内容を一覧表示します。
# ovmtlibrary -c list -l /export/user1/ovmtlibrary_example Oracle Virtual Machine for SPARC Template Library Utility ovmtlibrary Version: 3.3.0.0.12 Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. Templates present in path "/export/user1/ovmtlibrary_example" ID Name Version Description Date -------------------------------------------------------------------------------- 1 sol-11_2-ovm-2-sparc 1 ovmtlibrary example 2015-08-18
次のコマンドは、export/user1/ovmtlibrary_example ライブラリの詳細な一覧を表示します。
# ovmtlibrary -c list -i 1 -o -l /export/user1/ovmtlibrary_example Oracle Virtual Machine for SPARC Template Library Utility ovmtlibrary Version: 3.3.0.0.12 Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. Templates present in path "/export/user1/ovmtlibrary_example" ID Name Type Path Size(bytes) -------------------------------------------------------------------------------- 1 sol-11_2-ovm-2-sparc.ova ova /export/user1/ovmtlibrary_example/repository/templates/1/1/sol-11_2-ovm-2-sparc.ova 1018341888 2 sol-11_2-ovm-sparc.ovf ovf /export/user1/ovmtlibrary_example/repository/templates/1/1/sol-11_2-ovm-sparc.ovf 3532 3 sol-11_2-ovm-sparc.mf mf /export/user1/ovmtlibrary_example/repository/templates/1/1/sol-11_2-ovm-sparc.mf 137 4 System.img img /export/user1/ovmtlibrary_example/repository/templates/1/1/System.img 21474836480