Go to main content
Oracle® VM Server for SPARC 3.4 开发者指南

退出打印视图

更新时间: 2016 年 8 月
 
 

Oracle VM Server for SPARC 模板示例

示例 1  创建 Oracle VM Server for SPARC 模板

以下 ovmtcreate 命令基于名为 ovmtcreate_exampleldg1 域创建模板。请注意,生成的模板名称具有 .ova 后缀。

# ovmtcreate -d ldg1 -o ovmtcreate_example
...

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
示例 2  配置 Oracle VM Server for SPARC 模板属性

    您可以使用 ovmtconfigovmtprop 实用程序分别指定 Oracle VM Server for SPARC 模板属性值和 Oracle Solaris OS 属性值。

  • 以下 ovmtconfig 命令直接在 ldg1 域的文件系统上执行配置操作。

    –c 选项指定 /opt/ovmtutils/share/scripts/ovmt_s11_scprofile.sh 脚本来设置属性值。–p 选项为 com.oracle.solaris.network.ipaddrcom.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
    ...
    
    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
    Process completed
  • 以下 ovmtprop 命令指定 Oracle Solaris OS 属性值。

    primary# ovmtprop set-prop com.oracle.solaris.system.computer-name=test ldg1

    使用 ldm list -l 命令验证 com.oracle.solaris.system.computer-name 属性的值是否为 test

    primary# ldm list -l ldg1
    NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  NORM  UPTIME
    ldg1             active     -n----  5000    8     8G       0.0%  0.0%  23h 23m
    ..
    VARIABLES
        auto-boot?=true
        boot-file=-k
        pm_boot_policy=disabled=0;ttfc=2000;ttmr=0;
    
    VMAPI TO GUEST
        com.oracle.solaris.fmri.count=0
        com.oracle.solaris.system.computer-name=test
示例 3  部署 Oracle VM Server for SPARC 模板

以下 ovmtdeploy 命令通过在 /export/ovmtdeploy 目录中使用 ovmtcreate_example.ova Oracle VM Server for SPARC 模板创建名为 ldg1 的域。

# ovmtdeploy -d ldg1 -o /export/ovmtdeploy ovmtcreate_example.ova
...

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
示例 4  管理 Oracle VM Server for SPARC 模板库

    ovmtlibrary 通过组织文件以及存储、检索和编辑数据库中的信息来管理 Oracle VM Server for SPARC 模板的数据库和基于文件系统的系统信息库。

  • 以下命令将在 export/user1/ovmtlibrary_example 中创建模板库:

    # ovmtlibrary -c init -l /export/user1/ovmtlibrary_example
    ...
    
    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
    ...
    
    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
    ...
    
    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
    ...
    
    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
  • 以下命令从 export/user1/ovmtlibrary_example 库中删除模板 ID 1

    # ovmtlibrary -c delete -i 1 -l /export/user1/ovmtlibrary_example