Does udevadm work in XenServer? I am sure what I am trying to do is not supported, but would still think it would work.
More often than i care to admit, i need to get to the serial console port of various network switches. So i had a Linux box with a USB hub and . With a normal CentOS6 and CentOS7, i had given all kinds of /dev/ttyUSB_aliases
to each different RS232 cable.
[xcpng host]# ls /dev/ttyU*
/dev/ttyUSB0
/dev/ttyUSB0_ServerNetworkSwitch0
/dev/ttyUSB1
/dev/ttyUSB1_StorageNetworkSwitch1
/dev/ttyUSB2
/dev/ttyUSB2_StorageNetworkArista40Gb_Only200dollars
Each of the cables has a unique embedded serial number and I use the serial number to name each cable.
[xcpng host]# udevadm info /sys/bus/usb/devices/2-4.3
[xcpng host]# udevadm info /dev/ttyUSB0 | egrep '(SERIAL)'
E: ID_SERIAL=FTDI_FT232R_USB_UART_AM00I2M5
E: ID_SERIAL_SHORT=AM00I2M5
Adding the following to /etc/udev/rules.d/57-usb.rules
does not give me the symbolic links.
ENV{ID_SERIAL_SHORT}=="AM00I2M5", SYMLINK+="ttyUSB_AM00I2M5", SYMLINK+="ttyUSBARISTA1", SYMLINK+="ttyUSB_ARISTA1_Storage10GbX48"
ENV{ID_SERIAL_SHORT}=="AK08S3EG", SYMLINK+="ttyUSB_AK08S3EG", SYMLINK+="ttyUSBARISTA2", SYMLINK+="ttyUSB_ARISTA2_ServerSwitch_TopOfRack"
ENV{ID_SERIAL_SHORT}=="AK08S4NU", SYMLINK+="ttyUSB_AK08S4NU", SYMLINK+="ttyUSBARISTA3", SYMLINK+="ttyUSB_ARISTA3_Storage40GbX32"
udevadm trigger
or unplugging the USB hub to force it udev to reevaluate does not result in my sanity shortcuts:
[xcpng host]# find /dev -iname 'ttyU*'
/dev/ttyUSB2
/dev/ttyUSB1
/dev/ttyUSB0