diff --git a/packstack/plugins/cinder_250.py b/packstack/plugins/cinder_250.py index 1becc7b27..afe76eaac 100644 --- a/packstack/plugins/cinder_250.py +++ b/packstack/plugins/cinder_250.py @@ -85,8 +85,7 @@ def initConfig(controller): {"CMD_OPTION": "cinder-backend", "PROMPT": "Enter the Cinder backend to be configured", - "OPTION_LIST": ["lvm", "nfs", "vmdk", "netapp", - "solidfire"], + "OPTION_LIST": ["lvm", "nfs", "netapp", "solidfire"], "VALIDATORS": [validators.validate_options], "DEFAULT_VALUE": "lvm", "MASK_INPUT": False, diff --git a/packstack/puppet/modules/packstack/lib/puppet/functions/parse_hash_from_string.rb b/packstack/puppet/modules/packstack/lib/puppet/functions/parse_hash_from_string.rb new file mode 100644 index 000000000..c03797ed1 --- /dev/null +++ b/packstack/puppet/modules/packstack/lib/puppet/functions/parse_hash_from_string.rb @@ -0,0 +1,12 @@ +Puppet::Functions.create_function(:parse_hash_from_string) do + def parse_hash_from_string(*args) + if args.length > 1 + raise Puppet::Error, 'Argument must be one' + elsif !(args[0].kind_of?(String)) + raise Puppet::Error, 'Argument must be a string' + end + + value = args[0] + return Hash[value.scan(/(\S+)='([^']*)'/)] + end +end diff --git a/packstack/puppet/modules/packstack/manifests/cinder.pp b/packstack/puppet/modules/packstack/manifests/cinder.pp index 59e84c5ba..3ee5060f4 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder.pp @@ -8,7 +8,6 @@ class packstack::cinder () case $cinder_backends[0] { 'lvm': { $default_volume_type = 'iscsi' } 'nfs': { $default_volume_type = 'nfs' } - 'vmdk': { $default_volume_type = 'vmdk' } 'netapp': { $default_volume_type = 'netapp' } 'solidfire': { $default_volume_type = 'solidfire' } default: { $default_volume_type = 'iscsi' } diff --git a/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp b/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp index 3a5c166d1..58bd2e72a 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder/backend/lvm.pp @@ -74,7 +74,7 @@ RequiredBy=openstack-cinder-volume.service", cinder_type { 'iscsi': ensure => present, - properties => ['volume_backend_name=lvm'], + properties => {'volume_backend_name' => 'lvm'}, require => Class['cinder::api'], } } diff --git a/packstack/puppet/modules/packstack/manifests/cinder/backend/netapp.pp b/packstack/puppet/modules/packstack/manifests/cinder/backend/netapp.pp index dae461aac..9346b224b 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder/backend/netapp.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder/backend/netapp.pp @@ -127,7 +127,7 @@ class packstack::cinder::backend::netapp () cinder_type { $netapp_backend_name: ensure => present, - properties => ["volume_backend_name=${netapp_backend_name}"], + properties => {'volume_backend_name' => $netapp_backend_name}, require => Class['cinder::api'], } } diff --git a/packstack/puppet/modules/packstack/manifests/cinder/backend/nfs.pp b/packstack/puppet/modules/packstack/manifests/cinder/backend/nfs.pp index d7da98c5f..824a7d094 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder/backend/nfs.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder/backend/nfs.pp @@ -11,7 +11,7 @@ class packstack::cinder::backend::nfs () cinder_type { 'nfs': ensure => present, - properties => ['volume_backend_name=nfs'], + properties => {'volume_backend_name' => 'nfs'}, require => Class['cinder::api'], } } diff --git a/packstack/puppet/modules/packstack/manifests/cinder/backend/solidfire.pp b/packstack/puppet/modules/packstack/manifests/cinder/backend/solidfire.pp index 73b1c4d92..8bea6b737 100644 --- a/packstack/puppet/modules/packstack/manifests/cinder/backend/solidfire.pp +++ b/packstack/puppet/modules/packstack/manifests/cinder/backend/solidfire.pp @@ -14,7 +14,7 @@ class packstack::cinder::backend::solidfire () cinder_type { $solidfire_backend_name: ensure => present, - properties => ["volume_backend_name=${solidfire_backend_name}"], + properties => {'volume_backend_name' => $solidfire_backend_name }, require => Class['cinder::api'], } } diff --git a/packstack/puppet/modules/packstack/manifests/cinder/backend/vmdk.pp b/packstack/puppet/modules/packstack/manifests/cinder/backend/vmdk.pp deleted file mode 100644 index 067a638e0..000000000 --- a/packstack/puppet/modules/packstack/manifests/cinder/backend/vmdk.pp +++ /dev/null @@ -1,14 +0,0 @@ -class packstack::cinder::backend::vmdk () -{ - cinder::backend::vmdk { 'vmdk': - host_ip => lookup('CONFIG_VCENTER_HOST'), - host_username => lookup('CONFIG_VCENTER_USER'), - host_password => lookup('CONFIG_VCENTER_PASSWORD'), - } - - cinder_type { 'vmdk': - ensure => present, - properties => ['volume_backend_name=vmdk'], - require => Class['cinder::api'], - } -} diff --git a/packstack/puppet/modules/packstack/manifests/provision/glance.pp b/packstack/puppet/modules/packstack/manifests/provision/glance.pp index ee2bdf9a3..dbe4863de 100644 --- a/packstack/puppet/modules/packstack/manifests/provision/glance.pp +++ b/packstack/puppet/modules/packstack/manifests/provision/glance.pp @@ -1,9 +1,9 @@ class packstack::provision::glance () { - $image_name = lookup('CONFIG_PROVISION_IMAGE_NAME') - $image_source = lookup('CONFIG_PROVISION_IMAGE_URL') - $image_format = lookup('CONFIG_PROVISION_IMAGE_FORMAT') - $image_properties = lookup('CONFIG_PROVISION_IMAGE_PROPERTIES') + $image_name = lookup('CONFIG_PROVISION_IMAGE_NAME') + $image_source = lookup('CONFIG_PROVISION_IMAGE_URL') + $image_format = lookup('CONFIG_PROVISION_IMAGE_FORMAT') + $image_properties = lookup('CONFIG_PROVISION_IMAGE_PROPERTIES') glance_image { $image_name: ensure => present, @@ -11,6 +11,6 @@ class packstack::provision::glance () container_format => 'bare', disk_format => $image_format, source => $image_source, - properties => $image_properties + properties => parse_hash_from_string($image_properties) } } diff --git a/packstack/puppet/templates/controller.pp b/packstack/puppet/templates/controller.pp index 61da4f715..79c731216 100644 --- a/packstack/puppet/templates/controller.pp +++ b/packstack/puppet/templates/controller.pp @@ -52,7 +52,6 @@ if lookup('CONFIG_CINDER_INSTALL') == 'y' { case $cinder_backends[0] { 'lvm': { include 'packstack::cinder::backend::lvm' } 'nfs': { include 'packstack::cinder::backend::nfs' } - 'vmdk': { include 'packstack::cinder::backend::vmdk' } 'netapp': { include 'packstack::cinder::backend::netapp' } 'solidfire': { include 'packstack::cinder::backend::solidfire' } default: { include 'packstack::cinder::backend::lvm' }