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. 

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
28
29
30
  
       
Today