이 절에서는 다음 Oracle VM Server for SPARC 템플리트 작업의 예를 보여줍니다.
다음 ovmtcreate 명령은 ldg1 도메인을 기반으로 ovmtcreate_example이라는 템플리트를 만듭니다. 결과 템플리트 이름에는 .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
ldm list -l 명령을 사용하여 com.oracle.solaris.system.computer-name 등록 정보 값이 test인지 확인합니다.
# 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 명령은 ovmtcreate_example.ova Oracle VM Server for SPARC 템플리트를 사용하여 /export/ovmtdeploy 디렉토리에 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
다음 명령은 export/user1/ovmtlibrary_example 라이브러리에 sol-11_2-ovm-2-sparc.ova 템플리트를 저장합니다.
# 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