[root@pompeia16 ~]# mount | grep cassandra
/dev/md0 on /cassandra-data type ext4 (rw)
With this recipe:
mount '/cassandra-data' do
device 'cassandra-data'
device_type :label
fstype 'ext4'
options 'rw'
end
But is not working anymore with Chef 12.5.1:
pompeia16.datac.com Chef: 12.5.1 - NOK
pompeia6.datac.com Chef: 12.3.0 - OK
pompeia4.datac.com Chef: 12.3.0 - OK
pompeia10.datac.com Chef: 12.4.3 - OK
pompeia5.datac.com Chef: 12.3.0 - OK
pompeia9.datac.com Chef: 12.4.3 - OK
pompeia8.datac.com Chef: 12.4.1 - OK
pompeia2.datac.com Chef: 12.3.0 - OK
pompeia11.datac.com Chef: 12.4.3 - OK
pompeia7.datac.com Chef: 12.4.1 - OK
pompeia13.datac.com Chef: 12.4.3 - OK
pompeia12.datac.com Chef: 12.4.3 - OK
The error is:
* mount[/cassandra-data] action mount
================================================================================
Error executing action `mount` on resource 'mount[/cassandra-data]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of umount /cassandra-data ----
STDOUT:
STDERR: umount: /cassandra-data: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
---- End output of umount /cassandra-data ----
Ran umount /cassandra-data returned 1
Resource Declaration:
---------------------
# In /var/cache/chef/cookbooks/cassandra/recipes/pompeia.rb
42: mount '/cassandra-data' do
43: device 'cassandra-data'
44: device_type :label
45: fstype 'ext4'
46: options 'rw'
47: end
48:
Compiled Resource:
------------------
# Declared in /var/cache/chef/cookbooks/cassandra/recipes/pompeia.rb:42:in `from_file'
mount("/cassandra-data") do
action [:mount]
supports {:remount=>false}
retries 0
retry_delay 2
default_guard_interpreter :default
mount_point "/cassandra-data"
device "cassandra-data"
device_type :label
fsck_device "-"
fstype "ext4"
options "rw"
dump 0
pass 2
declared_type :mount
cookbook_name "cassandra"
recipe_name "pompeia"
end
Running handlers:
Running handlers complete
Chef Client failed. 1 resources updated in 17 seconds
I would assume this is unrelated to Chef 12.5.1, as it seems to be the unmount command in your actual system that is failing. It doesnāt look like chef/provider/mount/mount.rb has actually changed since June, which encompassed multiple recent releases. Is it possible that something else (i.e. not the 'cassandra-data' device) is currently mounted to /cassandra-data and thereās still something using it?
mount '/cassandra-data' do
device '/dev/md0'
device_type :label
fstype 'ext4'
options 'rw'
end
The device specified in your original resource seems to point to an arbitrary string, something you likely donāt want.
See https://docs.chef.io/resource_mount.html#examples for further examples of the mount resource.
EDIT: Upon review, I see youāre using the :label option, something I missed earlier. I guess adding debug logging to this would like help.
So you've told it to mount by label (device_type :label) but then you've given it a device name (device '/dev/md0') so it is probably trying to find a device with that label and mount it in place of the current mount.
Either change to device_type :device or specify a label as the device.
Unless you really do have a label of /dev/md0 in the device of course...
This worked with knife 12.3.0, but not with 12.5.1
* mount[/cassandra-data] action mount
================================================================================
Error executing action `mount` on resource 'mount[/cassandra-data]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of umount /cassandra-data ----
STDOUT:
STDERR: umount: /cassandra-data: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
---- End output of umount /cassandra-data ----
Ran umount /cassandra-data returned 1
Resource Declaration:
---------------------
# In /var/cache/chef/cookbooks/cassandra/recipes/pompeia.rb
42: mount '/cassandra-data' do
43: device 'cassandra-data'
44: device_type :device
45: fstype 'ext4'
46: options 'rw'
47: device '/dev/md0'
48: action [:mount, :enable]
49: end
Compiled Resource:
------------------
# Declared in /var/cache/chef/cookbooks/cassandra/recipes/pompeia.rb:42:in `from_file'
mount("/cassandra-data") do
action [:mount, :enable]
supports {:remount=>false}
retries 0
retry_delay 2
default_guard_interpreter :default
mount_point "/cassandra-data"
device "/dev/md0"
device_type :device
fsck_device "-"
fstype "ext4"
options "rw"
dump 0
pass 2
declared_type :mount
cookbook_name "cassandra"
recipe_name "pompeia"
end
James Belchamber wrote that back in Aug 2014, but it was only finally merged in 12.5.1
With the new code it does āmount now remouts if options changeā which means that if your options are different from the mounted options, chef detects the difference and remounts the filesystem. That fits with the declarative semantics of resources and my analogy to other resources like when you have file with action :create and the modes differ, we still fix the modes (the names we give the actions are, of course, not declarative which produces some confusion, but that ship sailed a long time ago).
So most likely you need to look at /proc/mounts and make sure that your options really match the mounted options of the filesystem now. Weāre probably trying to fix it so that the /only/ option on the filesystem is ārwā and you most likely have other options that show up in /proc/mounts is my guess.