Wednesday Jun 29, 2016

Oracle VM 3.4: export VMs details into a csv report file (ExportVmDetails)

The idea of this script came up more than one time in the past and target is to build-up a report of all VMs managed by an Oracle VM Manager on one or more Oracle VM Pools. Following script is compatible with Oracle VM 3.2, 3.3 and 3.4.

The output obtained is one csv file containing all the main informations related to all the VMs; the table will be composed of: 
  • Virtual Machine UUID (Unique ID)
  • Virtual Machine Name
  • Memory (amount of RAM allocated to the VM)
  • Max Memory (Max amount of RAM allocable to the VM without reboot)
  • Processors (Number of vCPUs)
  • Max Processors (Max number of vCPUs)
  • Processor Capacity (Increase or decrease the percentage to which the virtual CPUs can receive scheduled time)
  • Processor Priority (The higher the priority, the more physical CPU cycles are given to the virtual machine)
  • High Availability (H/A enabled or not for the VM)
  • Operating System (Descriptive field related to the OS installed on the VM)
  • VM Type (PVM, HVM or HVM with PV drivers)
  • Repository (Oracle VM Repository where vm.cfg file resides)
  • *vDisk Space Used (Disk space used by the vm - virtual-disks)
  • *vDisk Space Max (Disk space allocable by the vm - virtual-disks)
  • *Physical Disk size (Disk space used by the vm - physical-disks)

* = these options are only available on Oracle VM releases 3.3 and 3.4; on Oracle VM 3.2 release these three columns will be valued with "N/A".

The script, the install package and README file can be downloaded here

Installation process is pretty easy; just execute command "install.sh" and follow the interactive shell:

Last message of the installation package should be something similar to:

"OVMCLI Session successfully connected with key-based authentication!!!

like in the following picture:

The script "ExportVmDetails", available for default under path "/usr/local/bin" won't need any option and will supply an output similar to the following picture:

Obviously the same approach can be taken to generate further csv reports with all the informations related to an Oracle VM Pool.

As usually, feedback and comments are very welcome. 

If you need further informations, please visit:

Friday Jun 03, 2016

Oracle VM 3.4: identify orphan vdisks on repositories (find-vorph)

Identify orphan virtual-disks on repository can be a nightmare; mostly if you have more repositories and many virtual-disks to check.

  • What is it an orphan virtual-disk ?
==> An orphan virtual-disk is a virtual-device that is not associated to any virtual machine <==
  • Why do I need to identify them ?

==> Identify orphan virtual-disk can help to reclaim disk-space available on Oracle VM Repositories <==

So, like on many other examples, scripting with Oracle VM CLI can help us; here you can find a script able to identify all orphan virtual-disks; and you have two different options:

  • verify orphan virtual-disk on a specific repository
  • verify orphan virtual-disk on all repositories managed by Oracle VM Manager

The script is also able to supply the amount of disk-space recovered by deleting all orphan virtual-disks on a specific repository; output of the script will also present the Oracle VM CLI commands to execute to remove all orphan virtual-disks.

Script is compatible, able to interact and has been tested with:

  • Oracle VM 3.2
  • Oracle VM 3.3
  • Oracle VM 3.4 

Here you can find some execution examples:

  • Script executed on a specific repository (orphan virtual-disks identified and recoverable space specified)

  • Script executed on a specific repository (no orphan virtual-disks)

  • Script executed on all repositories (no repository specified)

To proceed to the setup pay attention to the README file attached to the download. 

Feedback and comments are, as always, appreciated. 

Thursday Mar 24, 2016

Oracle VM 3.4: guest hot backup on different repository (v0.8)

Not more than a couple of hours ago Oracle VM 3.4 has been announced on Virtualization Blog.

Here you can find the new version ( 0.8 ) of the HotCloneVm.sh script.

Download it here

Once downloaded, you'll find a zipped file containing:

  • "SetupSsh.sh" script to setup key-based authentication to Oracle VM Manager 3 CLI
  • "HotCloneVm.sh" script to execute guests hot-backups and proceed to apply retention policies
  • "HotCloneVM.pdf" containing a real user-guide to implement this backup strategy
  • "README_FIRST.txt" containing some tips to configure ssh timeout(s)  

Fixes introduced in 0.8:

  • Fixed Oracle VM CLI release check 

New features available in 0.7a:

  • Compatible with Oracle VM 3.3 / 3.4
  • Script is now able to identify Oracle VM Manager release and evaluate features enabled or not
  • New options for backup-type available: FULL, SNAP and OVA (OVA available only with 3.4 OVM Release)
    • FULL => HotClone will create a full vdisk backup on a further repository
    • SNAP => HotClone will create an ocfs2 reference-link snapshot of the vm on the same repository
    • OVA  => HotClone will create a packaged OVA file on a further repository
  • Retention is now applied on different backup-types
  • New definition of backup vm name:
    • $guest-OVA for OVA backup types
    • $guest-SNAP for ocfs2-reflink backup types
    • $guest-FULL for full-backup types
  • Retention continues to be applied also on old backups ( $guest-CLONE )

The hot-backup obtained by this script is always a crash-consistent backup of the running vm; if the VM owns also physical-disks, the backup will contain only virtual-disks and so, a manual intervention is needed to have it correctly booting/starting.

Here you can find one high-level picture of the target of this script:

The idea, here, is to have low-retention backups available on one NFS repository and medium/long retention on a Tape-Library / Further solution (see NDMP); an example could be to have latest 8/15 days (from 8 to 15) on the NFS share and oldest backups on the Tape-Library / NDMP.

So the retention can be managed between the two solutions (HotCloneVm script and Tape Library/NDMP) where:

  • HotCloneVm.sh will manage the low-retention on the NFS Repository
    • both Incremental and Full approaches are available with "SNAP" and "FULL"
  • Tape Library / NDMP will manage the long-retention on the Tape Library / NDMP solution
    • both Incremental and Full approaches can be managed by Tape Library / NDMP

Having the low-retention on the NFS will allow, moreover, to have a fast restore point for:

  • Single VM file restore or a list of them
    • Just start the VM, that resides on the NFS repository, with a temporary IP address and get files needed.
  • Entire VM restore
    • Stop the original VM and Start a snapshot and/or Clone/Move the FULL backup from the NFS
    • You can also evaluate to start the vm on the NFS repository to be even faster

Another option, available only with 3.4 release, is to have backups in OVA format; this option will allow to have backups that can be exported/imported to further Oracle VM Pools; for example you can use OVA exported to have the same VM available on a different Oracle VM Pool (like a clone from Production to Development) or on your laptop/desktop using VirtualBox.

First of all you need to setup an ssh-key exchange to obtain a self-authenticated system:

[scoter@ovmm: ~/Documents/OVM_34/HotCloneVm_0.7a]# ./SetupSsh.sh
#####################################################################################
You have to specify <guest id> or <guest name>:
Use SetupSsh.sh <Oracle VM Manager host> <Linux oracle user password> <Oracle VM Manager Password> 
Example:
SetupSsh.sh ovm-mgr.oracle.local oracle Welcome1
##########################################################################################
[scoter@ovmm: ~/Documents/OVM_34/HotCloneVm_0.7a]# 

NB: If you have already configured ssh-key exchange vs OVMCli you don't need to execute "SetupSsh.sh" script.

To identify syntax to be used, you have only to execute the command without any option:

[scoter@myhost: ~/]# ./HotCloneVm.sh
#####################################################################################
 You have to specify <guest id> or <guest name>:
 Use HotCloneVm.sh <Oracle VM Manager password> <Oracle VM Manager host> <guest name> <Oracle VM Server Pool> <target Repository> <Backup Retention> <backup_type>
 <backup_type> options are (no case-sensitive):
        - FULL => HotClone will create a full vdisk backup on a further repository
        - SNAP => HotClone will create an ocfs2 reference-link snapshot of the vm on the same repository
        - OVA  => HotClone will create a packaged OVA file on a further repository - available from 3.4
Example:
 HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget 8d FULL (retention will be 8 days)
 HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget d8 SNAP (retention will be 8 days)
 HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget 8c OVA  (retention will be 8 copies)
 HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget c8 FULL (retention will be 8 copies)
##########################################################################################

As usual, your feedback will be really appreciated. 

Wednesday Sep 11, 2013

Script: Know which dom(0) hold a dom(u)

More than one time we would like to know on which physical server our guest resides without open a new connection to our Oracle VM Manager.

So I created a little script that interact with Oracle VM Manager 3 CLI and supply us this information automatically.

Requirements:

- expect installed

- Oracle VM Manager network reachable

Executing the script:

########################################################
 While executing on Oracle VM Guest:
 Use whohost.sh <Oracle VM Manager password> <Oracle VM Manager host>
 Example:
           whohost.sh Welcome1 ovm-mgr.oracle.local
########################################################
#####################################################################################
 If executed from a client and want to specify <guest id> or <guest name>:
 Use whohost.sh <Oracle VM Manager password> <Oracle VM Manager host> <guest vmid(uuid)>
 Example <guest id>:
           whohost.sh Welcome1 ovm-mgr.oracle.local id=0004fb00000600006e13bfb3507a2f29
 Use whohost.sh <Oracle VM Manager password> <Oracle VM Manager host> <guest name>

 Example <guest name>:            whohost.sh Welcome1 ovm-mgr.oracle.local name=vmdb01 #####################################################################################

This little bash script could be executed on a client ( laptop ) or directly on a guest; when executed on a linux guest

we can evaluate to leave out the guest vmid or guest name ( the script automatically picks up the uuid of the guest ).

Execution examples:

From a laptop ( simple client ):

[scoter@area51: ~]# ./whohost.sh Welcome1 srvovmm.oracle.local name=srvtestdb01.oracle.local
 Name = srvtestdb01.oracle.local
 Id = 0004fb0000060000d84a68991ef40c69
 Operating System = Microsoft Windows Server 2008
 Server = 00:14:5e:bc:a7:e8:00:14:5e:bc:a7:e8:00:0e:0c:b1  [srvovm04.oracle.local]

From an Oracle VM guest ( linux ):

 [root@srvlnx01 ~]# ./whohost.sh Welcome1 srvovmm.oracle.local
  Name = srvlnx01.oracle.local
  Id = 0004fb0000060000a8e1af6d58064b4f
  Operating System = Oracle Linux 5
  Server = 00:14:5e:bc:a7:e8:00:14:5e:bc:a7:e8:00:0e:0c:b1  [srvovm02.oracle.local]

Here you can find the little script.

I would like to thank you my colleague Jerome Anten for the collaboration on building up this little but handy script.

Corrections, comments and enhancements are welcome.

Simon Coter

About

Simon Coter is a Principal Product Manager for Oracle VM and VirtualBox.

Search

Categories
Archives
« June 2016
SunMonTueWedThuFriSat
   
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
30
  
       
Today