IBM Support

VIOS Virtual Optical cheat sheet

How To


Summary

Here is a summary of commands to use with Virtual Optical Devices on IBM Power Systems

Objective

Banner_AIX_i_Linux
This assumes that you are familiar with the concept of using the virtual optical repository in the VIOS and gives a set of commonly used commands to act as an aide-memoire.

Environment

These commands are run in the VIOS at the command line. Nowadays, much of this work can also be carried out using the HMC Enhanced+ GUI.

Steps

To list what images are in the repository, run lsrep

$ lsrep
Size(mb) Free(mb) Parent Pool         Parent Size      Parent Free
  101985    83408 optical_sp               130944            28544

Name                                                  File Size Optical         Access
AIX72_1539A                                                3603 None            rw
AIX_ESP_71N.v1_1406A1                                      4077 None            ro
dvd.1415A_71N.v1                                           4076 None            rw
dvd.1415A_71N.v2                                           3018 None            rw
dvd.aix_1534A_720.v1                                       3803 None            rw
$

To check for loaded images, run lsvopt

The Media column lists any loaded media.

$ lsvopt
VTD             Media                                                 Size(mb)
vtopt0          dvd.aix_1534A_720.v1                                      3803

To unload media images, run the unloadopt command on all VTDs that have loaded images.

unloadopt -vtd <file-backed_virtual_optical_device >

To verify that all media are unloaded, run lsvopt again.

The command output should show No Media for all VTDs.

$ unloadopt -vtd vtopt0
$ lsvopt
VTD             Media                                                 Size(mb)
vtopt0          No Media                                                   n/a

Create a parent logical volume storage pool (can host the virtual media repository)

$ mksp -f  <Storage_pool>  hdisk1

Create the virtual media repository - eg: 20 GB size

$ mkrep -sp <Storage_pool> -size 20G

Create a blank virtual optical medium in the repository  

$ mkvopt -name <Virtual_Optical_disk_Name> -size 4G

Create a file-backed virtual optical device using vhost0 as VSCSI server adapter.

This creates “vtopt0” virtual target device.

$ mkvdev -fbo -vadapter vhost0

Load the file-backed virtual optical device with the media

$ loadopt -disk <Virtual_Optical_disk_Name> -vtd vtopt0

List the contents of the file-backed virtual optical devices

$ lsvopt
VTD             Media                                 Size (mb)
vtopt0          Virtual_Optical_Disk_Name             4096

Create a read only virtual optical media.

From physical media in /dev/cd0

$mkvopt -name <Virtual_Optical_Disk_Name_1> -dev cd0 -ro

From an ISO file on an NFS exported file system mounted at /mnt

$mkvopt  -name  <Virtual_Optical_Disk_Name_2> -file /mnt/AIX6.1TL0SP1.iso  -ro

Create a file-backed virtual optical device using vhost1 as VSCSI server adapter. This creates “vtopt1” virtual target device.

$ mkvdev -fbo -vadapter vhost1

Create another file-backed virtual optical device using vhost2 as VSCSI server adapter. This creates “vtopt2” virtual target device.

$ mkvdev -fbo -vadapter vhost2

Load the file-backed virtual optical devices “vtopt1” and “vtopt2 with the same virtual media  “Virtual_Optical_disk_Name1”

$ loadopt -vtd vtopt1 -disk <Virtual_Optical_disk_Name_1>
$ loadopt -vtd vtopt2 -disk <Virtual_Optical_disk_Name_1>

To force unload:

unloadopt -vtd <file-backed_virtual_optical_device > -release

Additional Information

You can contact me: 

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"HW1A1","label":"IBM Power Systems"},"Component":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF050","label":"BMC"},{"code":"PF041","label":"HMC"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
03 May 2021

UID

ibm11116993