diff --git a/openstack/blockstorage/v1/volumes/requests.go b/openstack/blockstorage/v1/volumes/requests.go index 3e9243ac..de9a381a 100644 --- a/openstack/blockstorage/v1/volumes/requests.go +++ b/openstack/blockstorage/v1/volumes/requests.go @@ -31,6 +31,8 @@ type CreateOpts struct { SnapshotID, SourceVolID, ImageID string // OPTIONAL VolumeType string + // OPTIONAL + Multiattach bool } // ToVolumeCreateMap assembles a request body based on the contents of a @@ -67,6 +69,9 @@ func (opts CreateOpts) ToVolumeCreateMap() (map[string]interface{}, error) { if opts.VolumeType != "" { v["volume_type"] = opts.VolumeType } + if opts.Multiattach { + v["multiattach"] = "1" + } return map[string]interface{}{"volume": v}, nil } diff --git a/openstack/blockstorage/v1/volumes/results.go b/openstack/blockstorage/v1/volumes/results.go index 2fd4ef14..c1a75be3 100644 --- a/openstack/blockstorage/v1/volumes/results.go +++ b/openstack/blockstorage/v1/volumes/results.go @@ -42,6 +42,9 @@ type Volume struct { // Arbitrary key-value pairs defined by the user. Metadata map[string]string `mapstructure:"metadata"` + // Multiattach denotes if the volume is multi-attach capable. + Multiattach bool `mapstructure:"multiattach"` + // Unique identifier for the volume. ID string `mapstructure:"id"` diff --git a/openstack/blockstorage/v2/volumes/requests.go b/openstack/blockstorage/v2/volumes/requests.go index 4c60936a..4ceeb0b5 100644 --- a/openstack/blockstorage/v2/volumes/requests.go +++ b/openstack/blockstorage/v2/volumes/requests.go @@ -40,6 +40,8 @@ type CreateOpts struct { ImageID string // The associated volume type [OPTIONAL] VolumeType string + // OPTIONAL + Multiattach bool } // ToVolumeCreateMap assembles a request body based on the contents of a @@ -82,6 +84,9 @@ func (opts CreateOpts) ToVolumeCreateMap() (map[string]interface{}, error) { if opts.VolumeType != "" { v["volume_type"] = opts.VolumeType } + if opts.Multiattach { + v["multiattach"] = "1" + } return map[string]interface{}{"volume": v}, nil }