mkvdev command

Purpose

Adds a virtual device to the system.

Syntax

To create a virtual target device:

mkvdev [ -f ] {-vdev TargetDevice | -dplc TDPhysicalLocationCode } { -vadapter VirtualServerAdapter | -aplc VSAPhysicalLocationCode} [ -dev DeviceName ]

To create a virtual target device for a file backed virtual optical device:

mkvdev -fbo { -vadapter VirtualServerAdapter | -aplc VSAPhysicalLocationCode } [-dev DeviceName]

To create a virtual target device when the backup device is part of a Peer-to-Peer Remote Copy (PPRC) pair:

mkvdev [ -f ] {-vdev TargetDevice | -dplc TDPhysicalLocationCode } { -vadapter VirtualServerAdapter | -aplc VSAPhysicalLocationCode} { -attr mirrored=true } [ -dev DeviceName ]

To create a shared Ethernet adapter:

mkvdev [-sea] TargetDevice -vadapter VirtualEthernetAdapter... -default DefaultVirtualEthernetAdapter -defaultid SEADefaultPVID [ -attr Attribute=Value [ Attribute=Value... ]] [ -migrate [ -auto]]

Note: The shared Ethernet adapter attributes, ha_mode and ctl_chan, must be specified together. The command fails if only one attribute is specified. These attributes are used to create a shared Ethernet adapter in a failover configuration.

To create an Link Aggregation adapter:

mkvdev -lnagg TargetAdapter... [ -attr Attribute=Value [ Attribute=Value... ] ] [ -migrate -auto [ -interface TargetInterface ] ]

To create a VLAN Ethernet adapter:

mkvdev -vlan TargetAdapter -tagid TagID

Description

The mkvdev command creates a virtual device. The name of the virtual device is automatically generated and assigned unless the -dev DeviceName flag is specified, in which case DeviceName becomes the device name.

If the backup device is part of a PPRC pair, set the mirrored attribute to TRUE to create the virtual target device. This allows a PPRC secondary device to be exported to the client partition.

If the -lnagg flag is specified, a Link Aggregation or IEEE 802.3 Link Aggregation (automatic Link Aggregation) device is created. To create an IEEE 802.3 Link Aggregation set the mode attribute to 8023ad. If the -sea flag is specified, a shared Ethernet adapter is created. The TargetDevice may be a Link Aggregation adapter (note, however, that the VirtualEthernetAdapter may not be Link Aggregation adapters). The default virtual Ethernet adapter, DefaultVirtualEthernetAdapter, must also be included as one of the virtual Ethernet adapters, VirtualEthernetAdapter.

The -fbo flag is used to create a virtual target device which maps the VirtualServerAdapter to a file backed virtual optical device. Virtual optical devices cannot be used until virtual media is loaded into the device. See the loadopt command for details.

The -vlan flag is used to create a VLAN device and the -vdev flag creates a virtual target device which maps the VirtualServerAdapter to the TargetDevice.

If the backup device that is specified by the -vdev or -dplc flags is already in use, an error is returned unless the -f flag is also specified. Also, the backup device that is specified cannot be a physical or logical volume that is assigned to a shared memory pool (to be used as a paging space device by a shared memory partition).

The mkvdev command also configures virtual optical and tape devices, where the -vdev or -dplc flag specifies the physical optical or tape device and the -vadapter or -aplc flag specifies the virtual SCSI adapter. If the specified optical or tape device is already assigned to a virtual SCSI adapter, an error is returned unless the -f flag is also specified. If the -f flag is specified, the optical or tape device will be removed from the virtual SCSI adapter it is currently assigned to before reassigning it to the new virtual SCSI adapter.

When an additional disk drive that has a lower max_transfer_size than the current setting is added, and it is set as a virtual target device (processing mkvdev), the client cannot recognize this device until the VIOS is rebooted and the max_transfer_size is reestablished to the new setting. Because the max_transfer_size cannot be dynamically changed, the mkvdev command checks the current max_transfer_size of the device being added. If it is lower, it posts a message stating that the VIOS must be rebooted before the client can see this device.

Attention: To protect the Configuration Database, the mkvdev command is not interruptible. Stopping this command before execution is complete could result in a corrupted database.

Flags

Flag name Description
-aplc VSAPhysicalLocationCode Specifies the virtual SCSI adapter using the physical location code
-attr Attribute=Value Specifies the device attribute value pairs to be used instead of the defaults. The Attribute=Value variable can be used to specify one attribute value pair or multiple attribute value pairs for one -attr flag. If you use an -attr flag with multiple attribute value pairs, the list of pairs must be enclosed in quotation marks with a blank space between the pairs. For example, entering -attr Attribute=Value lists one attribute value pair per flag, while entering -attr 'Attribute1=Value1 Attribute2=Value2' lists more than one attribute value pair.
-auto Migrates and restores the Ethernet interface when you create a shared Ethernet adapter with the -migrate option.
-default DefaultVirtualEthernetAdapter Default virtual adapter to use for non-VLAN-tagged packets. This flag maps to the shared Ethernet adapter device attribute pvid_adapter.
-defaultid SEADefaultPVID The SEADefaultPVID is the VID used for untagged frames. All untagged packets are assigned the SEADefaultPVID value. When a tagged frame is received by a port, the tag is used. Otherwise if the frame is untagged, the value contained in the PVID is considered as a tag. This flag maps to the shared Ethernet adapter device attribute pvid.
-dev DeviceName By using the -dev flag, you can specify the name you want the device to be known by. If you do not use the -dev flag, a name will be automatically generated and assigned. Not all devices support user-supplied names.
-dplc TDPhysicalLocationCode Specifies the physical device using the physical location code
-f Force the physical volume specified to be used as a backup device, even if it's already associated with a virtual SCSI adapter. If the specified backup device is an optical device, -f forces the optical device to be removed from the virtual SCSI adapter to which it is currently assigned, before reassigning it to the new virtual SCSI adapter.

The -f flag can also be used to force the mkvdev command to continue working when it fails, because the device is in use as a cluster device. The user must know every host to which the disk is visible and how it is used, before forcing the mkvdev command to continue working.

-fbo Create a virtual optical device.
-lnagg TargetAdapter... Creates a Link Aggregation device.
-migrate Migrates the settings from the physical adapter interface to the shared Ethernet adapter interface.
-sea TargetDevice Creates a shared Ethernet adapter which maps VirtualEthernetAdapter to the adapter TargetDevice. TargetDevice can be a physical adapter or a Link Aggregation adapter.
-tagid TagID Specifies the VLAN tag ID.
-vadapter VirtualEthernetAdapter or VirtualServerAdapter Specifies the virtual server adapter or virtual Ethernet adapter the new device will be mapped to. If multiple virtual Ethernet adapters are specified, separate the adapter names with commas and no spaces.
-vdev TargetDevice Creates a virtual device mapped to the physical/logical device TargetDevice and the virtual server adapter VirtualServerAdapter. The TargetDevice can be either a physical volume, logical volume, tape, USB HD, or optical device. Physical volumes assigned to volume groups cannot be used as target devices.
-vlan TargetAdapter Creates a Virtual Local Area Network device.
Note: While you create the shared Ethernet adapter, -auto and -migrate options do not support the migration of an IPv6 stateless configuration.

Exit Status

Return code Description
13 Specified physical or logical volume is not a valid.
21 Device is already in use. Use the -f flag to force assignment.
22 Logical volumes cannot be assigned as backup devices more than once.

Examples

  1. To create a virtual target device that maps the logical volume lv20 as a virtual disk for a client partition hosted by the vhost0 virtual server adapter, type the following command:
    mkvdev -vdev lv20 -vadapter vhost0

    The system displays the following message:

    vtscsi0 available
  2. To create a virtual target device that maps the physical volume hdisk6 as a virtual disk for a client partition served by the vhost2 virtual server adapter, type the following command:
    mkvdev -vdev hdisk6 -vadapter vhost2

    The system displays the following message:

    vtscsi1 available
  3. To create a virtual target device that maps physical tape device rmt0 as a virtual tape device for a client partition served by the vhost2 virtual server adapter, type the following command:
    mkvdev -vdev rmt0 -vadapter vhost2

    The system displays the following message:

    vttape0 available
  4. To create a shared Ethernet adapter that maps the physical Ethernet adapter ent4 as a virtual Ethernet adapter for the client partitions served by the virtual Ethernet adapters ent6, ent7, and ent9, using ent6 as the default adapter and 8 as the default ID, type the following command:
    mkvdev -sea ent4 -vadapter ent6 ent7 ent9 -default ent6 -defaultid 8

    The system displays the following message:

    ent10 available
  5. To create a shared Ethernet adapter in failover configuration with the control channel adapter ent5, create the shared Ethernet adapter as shown in example 4, but specify additional attributes ha_mode and ctl_chan with -attr. For example:
    mkvdev -sea ent4 -vadapter ent6 -default ent6 -defaultid 1 -attr ha_mode=auto ctl_chan=ent5
  6. To create an automatic Link Aggregation with primary adapters ent4 and ent5 and backup adapter ent6, type the following command:
    mkvdev -lnagg ent4 ent5 -attr backup_adapter=ent6 mode=8023ad

    The system displays the following message:

    ent10 available
  7. To create a virtual target device that maps the physical volume hdisk6, which is part of a PPRC pair as a virtual disk for a client partition served by the vhost2 virtual server adapter, type the following command:
    mkvdev -vdev hdisk6 -vadapter vhost2 -attr mirrored=true
  8. To migrate and restore the Ethernet interface while you create a shared Ethernet adapter, type the command as follows:
    mkvdev -sea ent4 -vadapter ent6 -default ent6 -defaultid 1 -attr ha_mode=auto 
    ctl_chan=ent5 -migrate -auto



Last updated: Wed, November 18, 2020