Logical Domains 1.3 Administration Guide

Managing Virtual Disks

This section describes adding a virtual disk to a guest domain, changing virtual disk and timeout options, and removing a virtual disk from a guest domain. See Virtual Disk Backend Options for a description of virtual disk options. See Virtual Disk Timeout for a description of the virtual disk timeout.

ProcedureAdd a Virtual Disk

  1. Export the virtual disk backend from a service domain.


    # ldm add-vdsdev [options={ro,slice,excl}] [mpgroup=mpgroup] \
    backend volume-name@service-name
    
  2. Assign the backend to a guest domain.


    # ldm add-vdisk [timeout=seconds] [id=disk-id] disk-name volume-name@service-name ldom
    

    You can specify an ID of a new virtual disk device by setting the id property. By default, ID values are automatically generated, so set this property if you need to match an existing device name in the OS. See Virtual Disk Identifier and Device Name.


    Note –

    A backend is actually exported from the service domain and assigned to the guest domain when the guest domain (ldom) is bound.


ProcedureExport a Virtual Disk Backend Multiple Times

A virtual disk backend can be exported multiple times either through the same or different virtual disk servers. Each exported instance of the virtual disk backend can then be assigned to either the same or different guest domains.

When a virtual disk backend is exported multiple times, it should not be exported with the exclusive (excl) option. Specifying the excl option will only allow exporting the backend once. The backend can be safely exported multiple times as a read-only device with the ro option.


Caution – Caution –

When a virtual disk backend is exported multiple times, applications running on guest domains and using that virtual disk are responsible for coordinating and synchronizing concurrent write access to ensure data coherency.


The following example describes how to add the same virtual disk to two different guest domains through the same virtual disk service.

  1. Export the virtual disk backend two times from a service domain by using the following commands.


    # ldm add-vdsdev [options={ro,slice}] backend volume1@service-name
    # ldm add-vdsdev -f [options={ro,slice}] backend volume2@service-name
    

    Note that the second ldm add-vdsdev command uses the -f option to force the second export of the backend. Use this option when using the same backend path for both commands and when the virtual disk servers are located on the same service domain.

  2. Assign the exported backend to each guest domain by using the following commands.

    The disk-name can be different for ldom1 and ldom2.


    # ldm add-vdisk [timeout=seconds] disk-name volume1@service-name ldom1
    # ldm add-vdisk [timeout=seconds] disk-name volume2@service-name ldom2

ProcedureChange Virtual Disk Options

  1. After a backend is exported from the service domain, you can change the virtual disk options by using the following command.


    # ldm set-vdsdev options=[{ro,slice,excl}] volume-name@service-name
    

ProcedureChange the Timeout Option

  1. After a virtual disk is assigned to a guest domain, you can change the timeout of the virtual disk by using the following command.


    # ldm set-vdisk timeout=seconds disk-name ldom
    

ProcedureRemove a Virtual Disk

  1. Remove a virtual disk from a guest domain by using the following command.


    # ldm rm-vdisk disk-name ldom
    
  2. Stop exporting the corresponding backend from the service domain by using the following command.


    # ldm rm-vdsdev volume-name@service-name