Map Physical Disks in OVM to their Page83 id

Here’s a quick awk script to map the output of “list PhysicalDisk” in the OVM CLI to show the physical disks name and it’s Page83 ID.  Run /tmp/doit on your OVM Manager server (remember to change the script to be executable first).

/tmp/doit:

#!/bin/bash
output=`ssh -l admin localhost -p 10000 "list physicaldisk"`

# take output of OVM CLI command "list physicaldisk", normalize the field separators
# and generate a table showing the physical disk to page83 mappings in a table
#
# field 3 = page83 id
# field 5 = Disk name
#

echo "$output" | grep id: | sed -e 's/  /:/g' | awk -F: -f /tmp/doit.awk

/tmp/doit.awk:

BEGIN { print "\nPhysical Disk Name   | Page83 ID                   "
for(c=0;c<56;c++) printf "-"
printf "\n" }
{ printf "%-20s | %-32s\n", $5, $3 }
END { for(c=0;c<56;c++) printf "-"
printf "\n" }
Advertisements

One thought on “Map Physical Disks in OVM to their Page83 id

  1. Pingback: Copying Virtual Machines between repositories in Oracle VM for x86 | Eric Steed – Technology Evangelist

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s