Quantcast
Channel: Oracle Blogs | Oracle Wim Coekaerts Blog
Viewing all articles
Browse latest Browse all 146

using ovm_utils

$
0
0
Now that we released Oracle VM 3.1 and I just added ovm_utils 0.5.2 on ARU, it's time to give a few examples/use cases of the utilities :)

The utilities are available for download from http://support.oracle.com search for patch name 13602094.

It's a small 2.5Mb zip file which you should install on the manager node and unzip in /u01/app/oracle/ovm-manager-3. There are manpages for the utilities as well. These are installed in /u01/app/oracle/ovm-manager-3/ovm_utils/man/man8. To make it easy, simply add this to your MANPATH : export MANPATH=/u01/app/oracle/ovm-manager-3/ovm_utils/man.

To use the utilities you need the admin username and password for the manager instance and in general you can just use localhost as the hostname. If you want to be able to connect to a remote manager instance, you have to first enable SSL on the manager node. By default we listen only on 127.0.0.1. There is an option in the utils to make a secure connection, use -X, but again, you first have to enable SSL for this. You can enable secure connections using ovm_utils and the addkeystore command. We have a support note for this.

So the format is something like : ./ovm_managercontrol -u admin -p mypassword -h localhost -c [options...]..
There are quite a few commands in the various utilities at this point. I broke the utilities up into categories :br

  • ovm_managercontrol : generic manager level functions
  • yuminfo : display yum configuration
    setupyum : configure yum
    addkeystore : configure the SSL keystore
    keystoreinfo : display keystore file and path
    createcpugroup : create a CPU Compatibility group
    removecpugroup : delete CPU Compatibility group
    addservertocpugroup : add server to CPU Compatibility group
    removeserverfromcpugroup : remove server from CPU Compatibility group
    listcpugroups : list all CPU Compatibility groups and its servers
    setsessiontimeout : set VM Console session timeout (Oracle VM 3.1+)
    getsessiontimeout : display VM Console session timeout(Oracle VM 3.1+)

  • ovm_repocontrol : generic repository level functions
  • list : list all repositories
    status : query repository status
    info : display repository information
    refresh : send a repository refresh command
    fixrepo : fix a failed repository create
    create : create repository on a storage device

  • ovm_poolcontrol : generic server pool level functions
  • status : display the current status of the server pool
    info : display server pool info such as memory, utilization, servers,...
    list : list all server pools registered with this Oracle VM Manager instance
    events : list all latest event types for this server pool
    addserver: add server to this server pool (-S server name)
    removeserver: remove server to this server pool (-S server name)
    refresh : refresh storage in the server pool

  • ovm_servercontrol : generic server level functions
  • start : use IPMI to power-on the server
    stop : shutdown the server
    kill : use IPMI to power-off the server
    mainton : turn on maintenance mode for this server
    maintoff : turn off maintenance mode for this server
    status : display the current status of the server (Running,Stopped,...)
    info : display server info such as memory, utilization, server-pool,...
    lock : temporarily lock the server disallowing any updates to happen
    upgrade : send an upgrade command to the server
    list : list all servers registered with this Oracle VM Manager instance
    events : list all latest event types for this server
    discover : discover server with provided hostname or IP address and Oracle VM agent password (-P)
    listnfsexports : list NFS exports on this server
    deletenfsexport : delete an NFS export on this server
    createnfsexport : create a new NFS export on this server

  • ovm_vmcontrol : generic Virtual Machine level functions
  • start : start the Virtual Machine
    stop : Power-off the Virtual Machine
    suspend : Suspend a running Virtual Machine
    kill : Kill the Virtual Machine
    resume : Resume a suspended Virtual Machine
    restart : Restart a running Virtual Machine (Power-off, start)
    status : display the current status of the Virtual Machine (Running, Stopped,Suspended)
    info : display Virtual Machine info such as memory, utilization, server-pool,...
    lock : temporarily lock the server disallowing any updates to happen
    events : list all latest events for this Virtual Machine requiring acknowledgement
    list : list all Virtual Machines registered with this Oracle VM Manager instance
    vcpuset : bind virtual cpu’s to physical threads for this Virtual Machine
    vcpuget : list bindings of virtual cpus to physical threads for this Virtual Machine
    settags : store a set of comma separate custom tags for a Virtual Machine
    gettags : retrieve list of tags for this Virtual Machine
    fixcfg : fix Virtual Machine Configuration file
    delete : delete Virtual Machine

  • ovm_vmdisks : a utility to list the virtual disk info for a given Virtual Machine
  • ovm_vmmessage : utility to send/receive message to/from a Virtual Machine using the Oracle VM VM API
  • Here a a few (hopefully) useful examples:

    # ovm_managercontrol -u admin -p Manager -h localhost -c getsessiontimeout
    # ovm_managercontrol -u admin -p Manager -h localhost -c setsessiontimeout -T 60

    Session timeout is the Oracle VM Console session timeout (connect to a Virtual Machine console). When you have a slow network, the default timeout of 30 seconds might be too short and this lets you set this to a longer (or shorter value).

    # ovm_servercontrol -u admin -p Manager -h localhost -c listnfsexports -s server1
    Oracle VM Server Control utility 0.5.1.
    Connected.
    Command : listnfsexports
    NFS Exports :
            id         : 0004fb0000230000978a28e2dc85e06b
            client     : ca-srs1
            options    :
            repository : SATA_ST3500320AS_5QM1EYTX
            path       : /OVS/Repositories/0004fb000003000031fac25b24740cca/
    ---
            id         : 0004fb00002300004b161fd1a0d106b7
            client     : ca-vdi1
            options    : rw,no_root_squash
            repository : SATA_ST3500320AS_5QM1EYTX
            path       : /OVS/Repositories/0004fb000003000031fac25b24740cca/
    ---
    Exit... 

    nfs exports are very useful and new in 3.1. It is now possible to export a local ocfs2 repository on a FC, iscsi or local disk device to be exported from an Oracle VM server to the outside world. You define which repository and which client can mount the repository. listnfsexports lists the exports defined on a specific Oracle VM Server.

    # ovm_servercontrol -u admin -p Manager -h localhost -c createnfsexport -s server1 
    -C ca-vdi1 -o rw,no_root_squash -r SATA_ST3500320AS_5QM1EYTX
    Oracle VM Server Control utility 0.5.1.
    Connected.
    Command : createnfsexport
    Creating nfs export for repository 'SATA_ST3500320AS_5QM1EYTX' on server.
    Created repository export
    Exit... 

    Here I have a repository named SATA_ST3500320AS_5QM1EYTX (this happens to be a local disk on server1) and I am exporting that repo through nfs to external server ca-vdi1. So now, on ca-vdi1, I can do mount server1:/OVS/Repositories/0004fb000003000031fac25b24740cca /mnt and I can backup(or restore) files.

    # /ovm_servercontrol -u admin -p Manager -h localhost -c deletenfsexport -s server1 
    -i 0004fb0000230000978a28e2dc85e06b
    Oracle VM Server Control utility 0.5.1.
    Connected.
    Command : deletenfsexport
    Deleting nfs export with ID '0004fb0000230000978a28e2dc85e06b'
    Deleted repository export
    Exit... 

    Simply deleting a repository. You need to specify the UUID of the nfs export, which you can find using listnfsexports.

    # ovm_repocontrol -u admin -p Manager -h localhost -c create -r foo -s wopr5 
    -i 3600144f057ef8a0000004fb3194b0001
    Oracle VM Repository Control utility 0.5.1.
    Connected.
    Command : create
    Found LUN with id '3600144f057ef8a0000004fb3194b0001'
    Creating Filesystem...
    Creating repository... Please wait...
    Create repository completed.
    Exit... 

    Create a repository on the LUN with a specific UUID. This works around slow storage where we hit a 2 minute timeout.

    # ovm_vmcontrol -u admin -p Manager -h ovmm -c vcpuget -v apitest
    Oracle VM VM Control utility 0.3.9.
    Connected.
    Command : vcpuget
    Current pinning of virtual CPUs to physical threads : 2,3

    Pinning virtual CPU's to physical threads.

    # ovm_vmcontrol -u admin -p Manager -h ovmm -c vcpuset -v apitest -s 5,6
    Oracle VM VM Control utility 0.3.9.
    Connected.
    Command : vcpuset
    Pinning virtual CPUs
    Pinning of virtual CPUs to physical threads '5,6''apitest' completed.
    A restart of Virtual Machine 'apitest' is required. 

    # vm_servercontrol  -u admin -p Manager -h localhost -s server -c events -A all
    Oracle VM Server Control utility 0.3.10.
    Connected.
    Command : events
    Server Events
    Acknowledging Virtual Machine events
            Virtual Machines on this server :
    VM : el5u4_32_pvm_1
    VM : el6u1_64_hvm_1
    VM : el5u7_64_hvm_1
    VM : el5u7_64_pvm_1
    VM : el6u1_64_pvm_1
    VM : el6u2bd5_32_pvhvm_1
    VM : el6u1_32_pvm_1
    VM : uek-boot-el5-64
    Exit..

    Acknowledging events on a given server, including any guest events.


    Viewing all articles
    Browse latest Browse all 146

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>