Setting a device online or offline

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest

Use the online device group attribute to set a CTCM device online or offline.

About this task

Setting a group device online associates it with an interface name. Setting the group device offline and back online with the same protocol preserves the association with the interface name. If you change the protocol before you set the group device back online, the interface name can change.
You must know the interface name to access the CTCM group device. To determine the assigned interface name, use the lszdev --existing command. For each online interface, the interface name is shown in the Name column. Alternatively, to determine the assigned interface name issue a command of the form:
# ls /sys/devices/ctcm/<device_bus_id>/net/ 

For each online interface, there is a symbolic link of the form /sys/class/net/<interface_name>/device in sysfs. You can confirm that you found the correct interface name by reading the link.

Procedure

To set a CTCM group device online, set the online device group attribute to 1. To set a CTCM group device offline, set the online device group attribute to 0.
Issue a command of this form:
# echo <flag> > /sys/bus/ccwgroup/drivers/ctcm/<device_bus_id>/online

Example

To set a CTCM device with bus ID 0.0.2000 online issue:
# echo 1 > /sys/bus/ccwgroup/drivers/ctcm/0.0.2000/online
To determine the interface name issue:
# lszdev --existing
TYPE         ID                          ON   PERS  NAMES
ctcm         0.0.2000:0.0.2001           yes  no    slc2000
or
# ls /sys/devices/ctcm/0.0.2000/net/
slc2000
To set group device 0.0.2000 offline issue:
# echo 0 > /sys/bus/ccwgroup/drivers/ctcm/0.0.2000/online