DETACH (Real Device)
Authorization
Privilege Class: B
Purpose
- Local or remote real devices from one or more virtual machines
- Local real devices from the host system
Note: When detaching a remote device, specify its logical device address.
Operands
- rdev
- rdev1-rdef2
- is a real device number, a list of real device numbers, or a range of real device numbers to be detached from the indicated user, from all users, or from the system. On a single command line, you may combine device numbers, lists of device numbers, and ranges of device numbers. Specify a real device number as one to four hexadecimal digits.
- ldev
- ldev1-ldev2
- is a logical device number, a list of logical device numbers, or a range of logical device numbers to be detached from the indicated user. On a single command line, you may combine device numbers, lists of device numbers, and ranges of device numbers. Specify a logical device number as an L followed by one to four hexadecimal digits.
- VOLid
- indicates that a volume serial number, which must follow this keyword, is used to identify the real device. If the volume serial number is valid as an operand of the command (e.g., is a valid device number), specify VOLid to indicate that the operand is a volume serial.
- volid
- specifies the 1- through 6-character volume serial number of a real DASD.
- EQid
- indicates that a device equivalency ID, which must follow this keyword, is used to identify the real device. If the EQID is valid, and only one device with the specified EQID is attached to the target, the detach will be performed. If more than one device with the specified EQID is attached to the target, no detach will be performed.
- eqid
- specifies a string of 1–8 alphanumeric characters for a user-specified EQID or a string of 50 alphanumeric characters plus a dash ("-") for a system-generated EQID.
- userid
- *
- identifies the virtual machine to which the device is currently attached. The specified user must be logged on, not in the process of logging on. If you are detaching a device from your own virtual machine, you may specify userid as an asterisk (*).
- ALL
- detaches a real device from all virtual machines without having to specify the user IDs. This operand can be used to detach devices attached with the MULTIUSER option. The ALL operand is not valid for devices attached to SYSTEM.
- SYSTEM
- detaches a DASD currently being used by CP for allocation and control.
- UNload
- detaches the tape device and automatically rewinds and unloads it. UNLOAD is the default if the tape was attached with the ASSIGN option.
- LEave
- detaches the tape device without rewinding and unloading it. The tape remains positioned as it was before issuing DETACH. LEAVE is the default if the tape was attached with the NOASSIGN or MULTIUSER option.
Usage Notes
- SET IMSG OFF will not suppress informational messages for this command.
- A previously attached device can be detached from a user, even if the device is still in use.
- When a device is detached from a user, all Concurrent Copy (CONCOPY) sessions associated with that device for that user are terminated in the storage control.
- When a device is detached, all data blocks associated with the device are removed from the minidisk cache.
- If you specify multiple device numbers or a range of device numbers on the DETACH (real device) command line, you receive an affirmative response for each device that is successfully detached and an error message for each device that cannot be detached.
- If you attempt to detach an active shared device from SYSTEM, you receive an error message indicating that the device is being shared by multiple users. In order to detach the device, each of the affected users must detach the device from their virtual systems.
- You cannot detach volumes in the CP-owned list that are in use by the system, shared by another system in an SSI cluster, or devices containing minidisks to which users are linked.
- If a tape device being detached was transferred to a user with the GIVE (Real Device) command, the LEAVE or UNLOAD option specified on the DETACH command overrides any option that was set when the GIVE command was issued. If LEAVE or UNLOAD is not specifically requested on the DETACH command, the option specified when GIVE was issued is processed. If no option was specified on either GIVE or DETACH, the tape is rewound and unloaded.
- If a device was attached using the CP ATTACH command and later detached, the system operator receives a response saying that the device was detached.
- For more information, see Usage Notes.
- When the primary or the secondary volume of a duplex pair is detached from a virtual machine, the response generated will indicate that the volume was either the primary duplex volume or the secondary duplex volume of the duplex pair. When the primary of a duplex pair is detached from the system, the response generated will indicate that the volume was the primary duplex volume of the duplex pair.
- A tape device attached with the SINGLEUSER option (the default) will automatically be unassigned
by CP when the device is detached, unless the LEAVE option is specified on DETACH or the tape was
attached with the NOASSIGN option.
A tape device attached with both the SINGLEUSER and NOASSIGN options will not be unassigned by CP when the device is detached, regardless of whether the tape is currently assigned by a guest. In other words, CP will not change the ASSIGNED or UNASSIGNED status of the drive. It is the responsibility of the guest to issue the ASSIGN CCW when it needs the tape drive and to issue the UNASSIGN CCW when it is finished using the drive.
- A tape device attached with the MULTIUSER option will be unassigned by CP when the device is detached, even though MULTIUSER implies NOASSIGN. This prevents one user from unexpectedly locking out many other users from the drive.
- When detaching Parallel Access Volume DASDs from a guest, all dedicated alias Parallel Access Volumes associated with a particular base Parallel Access Volume must be detached from that guest before that base Parallel Access Volume can be detached. When detaching Parallel Access Volume DASDs through VOLID, it is going to detach the base and alias associated with the base automatically.
- When detaching Parallel Access Volume DASDs from the system, all system attached alias Parallel Access Volumes associated with a particular base Parallel Access Volume must be detached from the system before that base Parallel Access Volume can be detached. When detaching Parallel Access Volume DASDs through VOLID, it is going to detach the base and alias associated with the base automatically.
- When detaching RDEVICEs using an EQID, if more than one device exists with the specified EQID, no detach will be performed. To avoid accidental detaches, some other unique identifier (such as the RDEV number) must be used in this situation.
- When a CP-owned DASD volume with SPOOL extents is detached from the owning system in an SSI cluster, an attempt will be made to automatically detach the volume from all other members in the SSI cluster.
Responses
The user who currently owns the device (if different from the primary system operator), the user who issues the DETACH (real device) command (if different from the owner of the device), and the primary system operator (if different from the user who issued the command) each receive messages indicating that the DETACH (real device) is successful.
Type | Meaning |
---|---|
CTCA | Channel-to-channel adapter |
CTLR | 3745 Communications Controller |
DASD | Direct access storage device |
FCP | SCSI device adapter |
GRAF | Display device |
MSC | Mass Storage Controller |
OSA | Open Systems Adapter |
PRT | Printer |
PUN | Card punch |
RDR | Card reader |
SWCH | Dynamic Switching device |
TAPE | Magnetic tape |
DEV | Any other device |
LINE | Communication line |
Response 1:
{type vdev} DETACHED BY originator [PRIMARY DUPLEX ]
{vdev… } [SECONDARY DUPLEX]
{vdev-vdev} [PAV BASE ]
[PAV ALIAS ]
[HYPERPAV BASE ]
[HYPERPAV ALIAS ]
is the response sent to the device owner (if the device owner is not the primary system operator).
Note that the response refers only to the virtual device number (vdev)
because this is the number by which the owner knows the device.Response 2:
{type rdev} DETACHED {userid [vdev]} [PRIMARY DUPLEX ]
{rdev… } {SYSTEM } [SECONDARY DUPLEX]
{rdev-rdev} [PAV BASE ]
{type ldev} [PAV ALIAS ]
{ldev… } [HYPERPAV BASE ]
{ldev-ldev} [HYPERPAV ALIAS ]
is the response issued to the originator of the DETACH (real device) command if the originator is
not the owner of the device or devices. When the response is for a single device
(rdev or ldev), the virtual device number, and
possibly the duplex state of the device, the PAV state of the device or the HyperPAV state of the
device will appear in the responses following the userid. Because the
secondary volume of a duplex pair cannot be attached to the system, SECONDARY DUPLEX will only be
issued when detaching from another user ID.Response 3:
{type rdev} DETACHED {userid [vdev]} BY originator [PRIMARY DUPLEX ]
{rdev… } {SYSTEM } [SECONDARY DUPLEX]
{rdev-rdev} [PAV BASE ]
{type ldev} [PAV ALIAS ]
{ldev… } [HYPERPAV BASE ]
{ldev-ldev} [HYPERPAV ALIAS ]
is the response sent to the primary system operator if another user (the originator) issued the
DETACH (real device) command. When the response is for a single device
(rdev or ldev), the virtual device number, and
possibly the duplex state of the device, the PAV state of the device or the HyperPAV state of the
device will appear in the responses following the userid. The secondary
volume of a duplex pair cannot be attached to the system, therefore SECONDARY DUPLEX will only be
issued when detaching from another user ID.{TAPE rdev} DETACHED userid BY originator {, TAPE VOLUME(S) UNLOADED }
{rdev… } { TAPE VOLUME(S) NOT UNLOADED}
{rdev-rdev}
is the response issued to the system operator when one or more tape volumes are being detached.
TAPE vdev RETURNED
is the response the user receives when a
tape drive given to another user through the GIVE command is returned.TAPE rdev RETURNED TO userid vdev
is the response the primary
system operator receives when a tape drive given to another user through the GIVE command is
returned.Detaching vdev has caused the termination of
CONCOPY session(s) on device(s): vdev1...
is the response the device owner receives if the process of detaching the device causes the
termination of Concurrent Copy (CONCOPY) sessions, and the device owner is the originator of the
DETACH command. The response lists the virtual devices that are part of the terminated CONCOPY
sessions.Detaching vdev by userid has caused the termination
of CONCOPY session(s) on device(s): vdev1...
is the response the device owner receives if the process of detaching the device causes the
termination of Concurrent Copy (CONCOPY) sessions, and the device owner is not the originator
of the DETACH command. The response identifies the originator of the DETACH command and lists the
virtual devices that are part of the terminated CONCOPY sessions.Detaching rdev has caused the termination of
CONCOPY session(s) for userid userid
is the response the originator of the DETACH command receives if the process of detaching the device
causes the termination of Concurrent Copy (CONCOPY) sessions, and the originator of the command is
not the owner of the device. The response identifies the user whose CONCOPY sessions have
been terminated.Detaching rdev by userid1 has caused the termination
of CONCOPY session(s) for userid userid2
is the response the primary system operator receives if the process of detaching the device from
user userid2 causes the termination of Concurrent Copy (CONCOPY) sessions,
and the system operator is not the originator of the DETACH command
(userid1).Messages
- HCP048E No device with EQID eqid attached.
- HCP048E No device with EQID eqid exists.
- HCP135E Multiple devices with EQID eqid attached.
- HCP135E Multiple devices with EQID eqid exist.