The bug is generic across all volume backends. I can also reproduce this with glusterfs. The bug is caused by a missing option passed to cinderclient, i.e. mode. By default, if mode is not passed to cinderclient.volumes.attach, the mode defaults to 'rw'. The structure of this method found in the Volume class under python-cinderclient/cinderclient/v2/volumes.py is as follows:
def attach(self, instance_uuid, mountpoint, mode='rw'):
When nova attaches a volume to an instance, the mode is ignored and not passed in, hence every time you attempt to attach a read-only volume, the mode gets set to 'rw' and fails with InvalidInput.
The bug is generic across all volume backends. I can also reproduce this with glusterfs. The bug is caused by a missing option passed to cinderclient, i.e. mode. By default, if mode is not passed to cinderclient. volumes. attach, the mode defaults to 'rw'. The structure of this method found in the Volume class under python- cinderclient/ cinderclient/ v2/volumes. py is as follows:
def attach(self, instance_uuid, mountpoint, mode='rw'):
When nova attaches a volume to an instance, the mode is ignored and not passed in, hence every time you attempt to attach a read-only volume, the mode gets set to 'rw' and fails with InvalidInput.