-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I have a udev rule that increases block timeouts for virtual machine block devices:
# cat /etc/udev/rules.d/99-blk-timeout.rules
ACTION=="add", SUBSYSTEMS=="scsi", ATTRS{vendor}=="VMware*", ATTRS{model}=="Virtual disk*", RUN+="/bin/sh -c 'echo 119 >/sys$DEVPATH/timeout'"
Executing a simple udevadm trigger does not invoke the "add" event needed to apply this rule.
To get this to work from the command like i have to run the following:
udevadm trigger --action="add" --subsystem-match="scsi" --attr-match=vendor="VMware*" --attr-match=model="Virtual disk*"
Or, in the case of puppet i've created an exec {} resources to perform this.
# Set timeout to 120 seconds for all VMware block devices
# to test: udevadm info -q all -a /dev/sda | grep timeout
udev::rule { '99-blk-timeout.rules':
ensure => present,
content => "ACTION==\"add\", SUBSYSTEMS==\"scsi\", ATTRS{vendor}==\"VMware*\", ATTRS{model}==\"Virtual disk*\", RUN+=\"/bin/sh -c 'echo 119 >/sys\$DEVPATH/timeout\'\"\n",
notify => Exec['udevadm trigger 99-blk-timeout.rules'],
}
# end udev rule
exec { 'udevadm trigger 99-blk-timeout.rules':
command => '/usr/sbin/udevadm trigger --action="add" --subsystem-match="scsi" --attr-match=vendor="VMware*" --attr-match=model="Virtual disk*"',
refreshonly => true,
subscribe => Udev::Rule['99-blk-timeout.rules'],
}
# end execute udevadm trigger
This is an OK solution, however udevadm trigger is being called twice. Once by udevadm::trigger and once by my exec call.
It would be awesome if we could pass in additional options into the udevadm trigger command so i didn't need my extra exec resource.
Maybe something like:
udev::rule { '99-blk-timeout.rules':
ensure => present,
content => "ACTION==\"add\", SUBSYSTEMS==\"scsi\", ATTRS{vendor}==\"VMware*\", ATTRS{model}==\"Virtual disk*\", RUN+=\"/bin/sh -c 'echo 119 >/sys\$DEVPATH/timeout\'\"\n",
trigger_options => '--action="add" --subsystem-match="scsi" --attr-match=vendor="VMware*" --attr-match=model="Virtual disk*"',
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels