Rescan scsi bus before using volume

Depending on the hypervisor and disk adapter used on the guest OS,
it may be necessary to rescan the SCSI bus before a Cinder volume
that has recently been attached is seen by the OS.  This patch installs
the scsitools package and rescans the bus prior to partitioning new
space from the attached volume.  It is harmless for
hypervisor/adapter/guestOS combinations that don't need it (other than
taking a tiny amount of disk space and a few seconds), and makes the
workload more portable for those that do.

Change-Id: Ibb33ec359343a7093cf3f6aa0d0a7e9086b9a55b
This commit is contained in:
Mark T. Voelker 2016-10-07 16:17:01 -04:00
parent b3975d45ff
commit 6046d9bc3d
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,12 @@
- stat: path=/tmp/diskflag
register: diskflag
- name: install scsitools
package: name=scsitools state=latest
- shell: /sbin/rescan-scsi-bus
when: diskflag.stat.exists == false
- shell: parted -s "{{ app_env.block_device_name }}" mklabel msdos
when: diskflag.stat.exists == false