Step for managing users

Before you begin

You need to log on as the system operator (if you followed Setting up the programmable operator, that user is LGLOPR) or MAINT, as indicated.

About this task

Tips:
  • If you need more information about a CP command, use the Help facility. From the command line, type this command and press the Enter key:
    help cp command_name
    where command_name is the CP command.
    Example:
    help cp force

    For CP command information, you can also consult z/VM: CP Commands and Utilities Reference.

  • For help information for DirMaint commands, use the DIRM HELP command. To display a menu of DirMaint HELP information, enter:
    dirm help
    Place the cursor under a command or topic for which you want information and then press the Enter key.
    To display information about a specific DirMaint command, type the following command and press the Enter key:
    dirm help command_name
    where command_name is the DirMaint command.
    Example:
    dirm help add
    The DirMaint HELP facility recognizes the short form of a DirMaint operand, so dirm help ad or dirm help a are also valid.
    To display information about the DIRMAINT command (DIRMAINT EXEC), type the following and press the Enter key:
    dirm help dirmaint
    You can also display information about a message (DVH1093 in this example) by typing the following and pressing the Enter key:
    dirm help dvh1093

    For information about DirMaint commands, you can also consult z/VM: Directory Maintenance Facility Commands Reference.

Procedure

Base your actions on the following table:
Table 1. Decision table for managing users
If you want to … Then use the following command …
Add a new directory entry. DIRM ADD

Issue this command from MAINT.

Example: To add a new user with user ID LINUX1, perform the following steps:
  1. Open a new DIRECT file on your A disk by issuing:
    xedit linux1 direct a
  2. Insert the following line into the file:
    USER LINUX1 TESTPASS
    This statement declares that you are defining a user directory entry with user ID LINUX1 and password TESTPASS.
  3. Save the file. At the XEDIT command line, type this command and press the Enter key:
    ====> file
  4. Add the new entry to the directory by typing the following and pressing the Enter key:
    dirm add linux1

You are done.

Note: Another useful function of the DirMaint ADD command is the ability to replicate (or clone) virtual machines from an existing prototype. For more information about using templates for cloning virtual machines, see Cloning Linux virtual servers.
Retrieve a copy of a user or profile directory entry, introduce new control statements or modify existing ones, then replace the entry. DIRM GET and DIRM REPLACE

Issue this command from MAINT.

Example: To add to the empty directory entry LINUX1 the OPTION QUICKDSP statement, perform the following steps:

  1. Get a copy of the LINUX1 directory entry by typing the following and pressing the Enter key:
    dirm for linux1 get
    Result: The GET command automatically locks the directory entry. If you are not planning to replace the entry after GET, then use DIRM GET NOLOCK instead. To remove the lock against the directory entry use the DIRM UNLOCK command.
  2. Open your reader by typing the following and pressing the Enter key:
    rdrlist
  3. Receive the LINUX1 DIRECT file to your A disk by putting your cursor in front of the LINUX1 DIRECT reader file and pressing PF9.
  4. Open the LINUX1 DIRECT A by typing the following and pressing the Enter key:
    xedit linux1 direct a
  5. In the prefix area before the USER statement, type i and press the Enter key.
  6. In the empty line, type OPTION QUICKDSP.
  7. Save the file. At the XEDIT command line, type this command and press the Enter key:
    ====> file
  8. Update the directory entry by issuing the DIRM REPLACE command:
    dirm for linux1 replace

You are done.

Delete a virtual machine (remove a directory entry from the source directory) DIRM PURGE

Issue this command from MAINT.

Use the Clean option to format the minidisks within the directory entry while command processing.

Example: To delete the LINUX1 directory entry and format all the disks within its definition, type the following and press the Enter key:
dirm for linux1 purge clean
Query, alter, or delete the current profile entry for a user. The profile entry consolidates other directory statements that are used in common by multiple directory entries. DIRM INCLUDE

Issue this command from MAINT.

The INCLUDE statement specifies the name of a profile entry to be invoked as part of the directory entry.

Example: To include the PROFILE LINDFLT into the USER LINUX1, type the following and press the Enter key:
dirm for linux1 include lindflt
Prevent or allow a user from making any changes to his or her directory entry. DIRM LOCK/UNLOCK

Issue this command from MAINT.

The UNLOCK operand is used to remove the lock against the directory entry.

Example: To lock the directory entry of the user LINUX1, type the following and press the Enter key:
dirm for linux1 lock
Add a minidisk to a Linux® virtual server DIRM AMDISK

Issue this command from MAINT.

Use the region/volume/group id from your EXTENT CONTROL file to point out which DASD extents to use while allocating a new minidisk. Use AUTOR/AUTOV/AUTOG parameters when allocating within a region/volume/group, respectively.

Example: To create a new minidisk for user LINUX1 within the DASD group GRPLNX with virtual address 200, a size of 5 cylinders, and mode of MR, type the following and press the Enter key:
dirm for linux1 amdisk 200 x autog 5 grplnx mr
The following describes the modes:
R
Read-only (R/O) access is desired. The access is not given if any other user has a link to the disk in write or exclusive status.
RR
Read-only (R/O) access is desired, even if another user has a link to the disk in write status. Access is denied if any user has an exclusive link.
W
Write access is desired. The disk is not accessible if any other user has a link to the disk in read or write status.
WR
Write access is desired, but read-only access is acceptable if any other user has a link to the disk in read or write status. Access is denied if any user has an exclusive link.
M
Multiple access is desired. A write link to the disk is given unless another user already has write or any exclusive access to it; in which case, the disk is not accessible.
MR
Write access to the minidisk is desired unless another user already has write or any exclusive access to it. In this case, read-only access to the minidisk is allowed. Access is denied if any user has an exclusive link.
MW
Unconditional write access to the disk is desired. Access is denied if any user has an exclusive or stable link.
Change a minidisk size or location. DIRM CMDISK

Issue this command from MAINT.

Use the region/volume/group id from your EXTENT CONTROL file to point out which DASD extents to use while allocating a new minidisk. Use AUTOR/AUTOV/AUTOG parameters when allocating within a region/volume/group, respectively.

Example: To change the location of minidisk 200 of user LINUX1 to the LINUX01 region and to change its size to 3 cylinders, type the following and press the Enter key:
dirm for linux1 cmdisk 200 x autor 3 linux01 
Delete a minidisk from a directory entry. DIRM DMDISK

Issue this command from MAINT.

Use the Clean option to format the minidisk while deleting it.

Example: To delete the minidisk from the LINUX1 user definition and format it, type the following and press the Enter key:
dirm for linux1 dmdisk 200 clean
Request that a LINK control statement be inserted in a directory entry and put into effect automatically each time the user logs on. DIRM LINK

Issue this command from MAINT.

Example: To establish an MR link to minidisk 200, which is owned by LINUX1, as minidisk 9200 within a user definition of LINUX2, type the following and press the Enter key:
dirm for linux2 link linux1 200 9200 mr
Permanently change the line end character for a user (the user's virtual console) DIRM FOR userid TERM LINEND char

Issue this command from MAINT.

Example:
dirm for linux01 term linend pct
Permanently change the storage size of a virtual machine DIRM FOR userid STORAGE nnnM

Issue this command from MAINT.

Example:
dirm for linux01 storage 256M
Display the number of logged-on users CP QUERY USERS

Issue this command from LGLOPR.

Example:
query users                      
8 USERS,    0 DIALED,     0 NET
Ready;                              
Display a user ID and device address of the user CP QUERY userid

Issue this command from LGLOPR.

Example:
query linux1   
LINUX1   -L008B 
Ready;
List logged on users and addresses CP QUERY NAMES

Issue this command from LGLOPR.

Example:
query names
LINUX1   -L008E, LINUX2   -L0094, LINUX3   -L008B, MONWRITE - DSC  
LINUX4   -L0082, LINUX5   -L003E, LINUX6   -L008A, LINUX6   -L0086
Ready;
DSC means the virtual machine is running in disconnected mode.
Grant a user access to a virtual switch SET VSWITCH
Example: To grant LINUX02 access to virtual switch SSISW, issue the following command:
set vswitch ssisw grant linux02
Log off an active user CP FORCE userid

Issue this command from LGLOPR.

Example:
FORCE LINUX01
GRAF  0020 LOGOFF AS  LINUX01  USERS = 875   FORCED BY LGLOPR
Log on another virtual machine CP XAUTOLOG

Issue this command from LGLOPR.

Example:
xautolog linux03
Command accepted
AUTO LOGON *** LINUX03  USERS = 24 BY LGLOPR
Ready;
Check to see whether a Linux virtual server is enabled for the shutdown signal QUERY SIGNALS

Issue this command from LGLOPR.

Example:
query signals
                                        Signalled  Timeout
Userid        Signal    Signal Status   By         Remaining
LINUX01       SHUTDOWN  Enabled         -          -
LINUX02       SHUTDOWN  Enabled         -          -
LINUX03       SHUTDOWN  Enabled         -          -
LINUX04       SHUTDOWN  Enabled         -          -
Signal a virtual machine to shut down CP SIGNAL SHUTDOWN userid WITHIN seconds

Issue this command from LGLOPR.

Example:
signal shutdown linux04 within 300
Ready;

Results

You are done when you have successfully managed the users.