From c84627b94f05eeabb2e0f18dcfb9725a4f12cc1f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 7 Oct 2024 12:45:02 +0900 Subject: [PATCH] Remove support for VMWare Datastore store driver We removed vmwareapi virt driver support of puppet-nova during 2023.2 cycle[1] and have heard no feedback about it so far. This indicates no actual users of Puppet OpenStack modules are using our modules to manage OpenStack clusters integrated with VMWare. Therefore, remove support for the VMWare Datastore store driver which we deprecated in 2023.2 release[1]. [1] fb29ff5f38de801438df46949fdd6680ef815f19 Change-Id: I1e6de70acdd9d557043914caf7e4ed2da4519958 --- manifests/backend/multistore/vsphere.pp | 131 ------------------ manifests/backend/vsphere.pp | 115 --------------- ...move-vsphere-backend-636f815d495acb05.yaml | 4 + spec/classes/glance_backend_vsphere_spec.rb | 99 ------------- .../glance_backend_multistore_vsphere_spec.rb | 106 -------------- 5 files changed, 4 insertions(+), 451 deletions(-) delete mode 100644 manifests/backend/multistore/vsphere.pp delete mode 100644 manifests/backend/vsphere.pp create mode 100644 releasenotes/notes/remove-vsphere-backend-636f815d495acb05.yaml delete mode 100644 spec/classes/glance_backend_vsphere_spec.rb delete mode 100644 spec/defines/glance_backend_multistore_vsphere_spec.rb diff --git a/manifests/backend/multistore/vsphere.pp b/manifests/backend/multistore/vsphere.pp deleted file mode 100644 index 334b4d41..00000000 --- a/manifests/backend/multistore/vsphere.pp +++ /dev/null @@ -1,131 +0,0 @@ -# -# Copyright 2019 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# == Define: glance::backend::multistore::vsphere -# -# DEPRECATED !! -# Used to configure vsphere backends for glance -# -# === Parameters -# -# [*vmware_insecure*] -# (optional) If true, the ESX/vCenter server certificate is not verified. -# If false, then the default CA truststore is used for verification. -# This option is ignored if "vcenter_ca_file" is set. -# Defaults to 'True'. -# -# [*vmware_ca_file*] -# (optional) The name of the CA bundle file which will be used in -# verifying vCenter server certificate. If parameter is not set -# then system truststore is used. If parameter is set, -# vcenter_insecure value is ignored. -# Defaults to $facts['os_service_default']. -# -# [*vmware_datastores*] -# (Multi-valued) A list of datastores where the image -# can be stored. This option may be specified multiple times -# for specifying multiple datastores. The datastore name should -# be specified after its datacenter path, separated by ":". -# An optional weight may be given after the datastore name, -# separated again by ":". Thus, the required format -# becomes ::. -# When adding an image, the datastore with highest weight will be selected, -# unless there is not enough free space available in cases where the image -# size is already known. If no weight is given, it is assumed to be -# zero and the directory will be considered for selection last. -# If multiple datastores have the same weight, then the one with the most -# free space available is selected. -# Defaults to $facts['os_service_default']. -# -# [*vmware_server_host*] -# (required) vCenter/ESXi Server target system. -# Should be a valid an IP address or a DNS name. -# -# [*vmware_server_username*] -# (required) Username for authenticating with vCenter/ESXi server. -# -# [*vmware_server_password*] -# (required) Password for authenticating with vCenter/ESXi server. -# -# [*vmware_store_image_dir*] -# (required) The name of the directory where the glance images will be stored -# in the VMware datastore. -# -# [*vmware_task_poll_interval*] -# (optional) The interval used for polling remote tasks invoked on -# vCenter/ESXi server. -# Defaults to $facts['os_service_default']. -# -# [*vmware_api_retry_count*] -# (optional) Number of times VMware ESX/VC server API must be retried upon -# connection related issues. -# Defaults to $facts['os_service_default']. -# -# [*store_description*] -# (optional) Provides constructive information about the store backend to -# end users. -# Defaults to $facts['os_service_default']. -# -# [*weight*] -# (optional) Define a relative weight for this store over any others that -# are configured. -# Defaults to $facts['os_service_default']. -# -define glance::backend::multistore::vsphere( - $vmware_server_host, - $vmware_server_username, - $vmware_server_password, - $vmware_store_image_dir, - $vmware_ca_file = $facts['os_service_default'], - $vmware_datastores = $facts['os_service_default'], - $vmware_insecure = 'True', - $vmware_task_poll_interval = $facts['os_service_default'], - $vmware_api_retry_count = $facts['os_service_default'], - $store_description = $facts['os_service_default'], - $weight = $facts['os_service_default'], -) { - - include glance::deps - - warning("The VMWare Datastore store driver support has been deprecated. \ -It will be removed in a future release.") - - glance_api_config { - "${name}/vmware_insecure": value => $vmware_insecure; - "${name}/vmware_ca_file": value => $vmware_ca_file; - "${name}/vmware_server_host": value => $vmware_server_host; - "${name}/vmware_server_username": value => $vmware_server_username; - "${name}/vmware_server_password": value => $vmware_server_password, secret => true; - "${name}/vmware_store_image_dir": value => $vmware_store_image_dir; - "${name}/vmware_task_poll_interval": value => $vmware_task_poll_interval; - "${name}/vmware_api_retry_count": value => $vmware_api_retry_count; - "${name}/vmware_datastores": value => $vmware_datastores; - "${name}/store_description": value => $store_description; - "${name}/weight": value => $weight; - } - - glance_cache_config { - "${name}/vmware_insecure": value => $vmware_insecure; - "${name}/vmware_ca_file": value => $vmware_ca_file; - "${name}/vmware_server_host": value => $vmware_server_host; - "${name}/vmware_server_username": value => $vmware_server_username; - "${name}/vmware_server_password": value => $vmware_server_password, secret => true; - "${name}/vmware_store_image_dir": value => $vmware_store_image_dir; - "${name}/vmware_task_poll_interval": value => $vmware_task_poll_interval; - "${name}/vmware_api_retry_count": value => $vmware_api_retry_count; - "${name}/vmware_datastores": value => $vmware_datastores; - "${name}/weight": value => $weight; - } -} diff --git a/manifests/backend/vsphere.pp b/manifests/backend/vsphere.pp deleted file mode 100644 index 6a98a077..00000000 --- a/manifests/backend/vsphere.pp +++ /dev/null @@ -1,115 +0,0 @@ -# -# Copyright (C) 2014 Mirantis -# -# Author: Stepan Rogov -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# == Class: glance::backend::vsphere -# -# Setup Glance to backend images into VMWare vCenter/ESXi -# -# === Parameters -# -# [*vcenter_insecure*] -# (optional) If true, the ESX/vCenter server certificate is not verified. -# If false, then the default CA truststore is used for verification. -# This option is ignored if "vcenter_ca_file" is set. -# Defaults to 'True'. -# -# [*vcenter_ca_file*] -# (optional) The name of the CA bundle file which will be used in -# verifying vCenter server certificate. If parameter is not set -# then system truststore is used. If parameter is set, -# vcenter_insecure value is ignored. -# Defaults to $facts['os_service_default']. -# -# [*vcenter_datastores*] -# (Multi-valued) A list of datastores where the image -# can be stored. This option may be specified multiple times -# for specifying multiple datastores. The datastore name should -# be specified after its datacenter path, separated by ":". -# An optional weight may be given after the datastore name, -# separated again by ":". Thus, the required format -# becomes ::. -# When adding an image, the datastore with highest weight will be selected, -# unless there is not enough free space available in cases where the image -# size is already known. If no weight is given, it is assumed to be -# zero and the directory will be considered for selection last. -# If multiple datastores have the same weight, then the one with the most -# free space available is selected. -# Defaults to $facts['os_service_default']. -# -# [*vcenter_host*] -# (required) vCenter/ESXi Server target system. -# Should be a valid an IP address or a DNS name. -# -# [*vcenter_user*] -# (required) Username for authenticating with vCenter/ESXi server. -# -# [*vcenter_password*] -# (required) Password for authenticating with vCenter/ESXi server. -# -# [*vcenter_image_dir*] -# (required) The name of the directory where the glance images will be stored -# in the VMware datastore. -# -# [*vcenter_task_poll_interval*] -# (optional) The interval used for polling remote tasks invoked on -# vCenter/ESXi server. -# Defaults to $facts['os_service_default']. -# -# [*vcenter_api_retry_count*] -# (optional) Number of times VMware ESX/VC server API must be retried upon -# connection related issues. -# Defaults to $facts['os_service_default']. -# -# [*multi_store*] -# (optional) Boolean describing if multiple backends will be configured -# Defaults to false. -# -class glance::backend::vsphere( - $vcenter_host, - $vcenter_user, - $vcenter_password, - $vcenter_image_dir, - $vcenter_ca_file = $facts['os_service_default'], - $vcenter_datastores = $facts['os_service_default'], - $vcenter_insecure = 'True', - $vcenter_task_poll_interval = $facts['os_service_default'], - $vcenter_api_retry_count = $facts['os_service_default'], - Boolean $multi_store = false, -) { - - include glance::deps - - warning('glance::backend::vsphere is deprecated. Use glance::backend::multistore::vsphere instead.') - - glance::backend::multistore::vsphere { 'glance_store': - vmware_server_host => $vcenter_host, - vmware_server_username => $vcenter_user, - vmware_server_password => $vcenter_password, - vmware_store_image_dir => $vcenter_image_dir, - vmware_ca_file => $vcenter_ca_file, - vmware_datastores => $vcenter_datastores, - vmware_insecure => $vcenter_insecure, - vmware_task_poll_interval => $vcenter_task_poll_interval, - vmware_api_retry_count => $vcenter_api_retry_count, - store_description => undef, - } - - if !$multi_store { - glance_api_config { 'glance_store/default_store': value => 'vsphere'; } - glance_cache_config { 'glance_store/default_store': value => 'vsphere'; } - } -} diff --git a/releasenotes/notes/remove-vsphere-backend-636f815d495acb05.yaml b/releasenotes/notes/remove-vsphere-backend-636f815d495acb05.yaml new file mode 100644 index 00000000..4fa728ac --- /dev/null +++ b/releasenotes/notes/remove-vsphere-backend-636f815d495acb05.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Support for VMWare Datastore store driver has been removed. diff --git a/spec/classes/glance_backend_vsphere_spec.rb b/spec/classes/glance_backend_vsphere_spec.rb deleted file mode 100644 index ca88014f..00000000 --- a/spec/classes/glance_backend_vsphere_spec.rb +++ /dev/null @@ -1,99 +0,0 @@ -# -# Copyright (C) 2014 Mirantis -# -# Author: Steapn Rogov -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# Unit tests for glance::backend::vsphere class -# - -require 'spec_helper' - -describe 'glance::backend::vsphere' do - - let :pre_condition do - 'class { "glance::api::authtoken": password => "pass" }' - end - - shared_examples_for 'glance with vsphere backend' do - let :params do - { - :vcenter_host => '10.0.0.1', - :vcenter_user => 'root', - :vcenter_password => '123456', - :vcenter_datastores => 'Datacenter:Datastore', - :vcenter_image_dir => '/openstack_glance', - } - end - - context 'when default parameters' do - it 'configures glance-api.conf' do - is_expected.to contain_glance_api_config('glance_store/default_store').with_value('vsphere') - is_expected.to contain_glance_api_config('glance_store/vmware_insecure').with_value('True') - is_expected.to contain_glance_api_config('glance_store/vmware_server_host').with_value('10.0.0.1') - is_expected.to contain_glance_api_config('glance_store/vmware_server_username').with_value('root') - is_expected.to contain_glance_api_config('glance_store/vmware_server_password').with_value('123456').with_secret(true) - is_expected.to contain_glance_api_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance') - is_expected.to contain_glance_api_config('glance_store/vmware_task_poll_interval').with_value('') - is_expected.to contain_glance_api_config('glance_store/vmware_api_retry_count').with_value('') - is_expected.to contain_glance_api_config('glance_store/vmware_datastores').with_value('Datacenter:Datastore') - is_expected.to contain_glance_api_config('glance_store/vmware_ca_file').with_value('') - end - it 'configures glance-cache.conf' do - is_expected.to contain_glance_cache_config('glance_store/default_store').with_value('vsphere') - is_expected.to contain_glance_cache_config('glance_store/vmware_insecure').with_value('True') - is_expected.to contain_glance_cache_config('glance_store/vmware_server_host').with_value('10.0.0.1') - is_expected.to contain_glance_cache_config('glance_store/vmware_server_username').with_value('root') - is_expected.to contain_glance_cache_config('glance_store/vmware_server_password').with_value('123456').with_secret(true) - is_expected.to contain_glance_cache_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance') - is_expected.to contain_glance_cache_config('glance_store/vmware_task_poll_interval').with_value('') - is_expected.to contain_glance_cache_config('glance_store/vmware_api_retry_count').with_value('') - is_expected.to contain_glance_cache_config('glance_store/vmware_datastores').with_value('Datacenter:Datastore') - is_expected.to contain_glance_cache_config('glance_store/vmware_ca_file').with_value('') - end - end - - context 'when overriding parameters' do - before do - params.merge!({ - :vcenter_ca_file => '/etc/glance/vcenter-ca.pem', - :vcenter_task_poll_interval => '6', - :vcenter_api_retry_count => '11', - }) - end - it 'configures glance-api.conf' do - is_expected.to contain_glance_api_config('glance_store/vmware_ca_file').with_value('/etc/glance/vcenter-ca.pem') - is_expected.to contain_glance_api_config('glance_store/vmware_task_poll_interval').with_value('6') - is_expected.to contain_glance_api_config('glance_store/vmware_api_retry_count').with_value('11') - end - it 'configures glance-cache.conf' do - is_expected.to contain_glance_cache_config('glance_store/vmware_ca_file').with_value('/etc/glance/vcenter-ca.pem') - is_expected.to contain_glance_cache_config('glance_store/vmware_task_poll_interval').with_value('6') - is_expected.to contain_glance_cache_config('glance_store/vmware_api_retry_count').with_value('11') - end - end - end - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge!(OSDefaults.get_facts()) - end - - it_configures 'glance with vsphere backend' - end - end -end diff --git a/spec/defines/glance_backend_multistore_vsphere_spec.rb b/spec/defines/glance_backend_multistore_vsphere_spec.rb deleted file mode 100644 index 6573b0b8..00000000 --- a/spec/defines/glance_backend_multistore_vsphere_spec.rb +++ /dev/null @@ -1,106 +0,0 @@ -# -# Copyright 2019 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# Unit tests for glance::backend::multistore::vsphere -# - -require 'spec_helper' - -describe 'glance::backend::multistore::vsphere' do - let (:title) { 'vsphere' } - - let :pre_condition do - 'class { "glance::api::authtoken": password => "pass" }' - end - - shared_examples_for 'glance::backend::multistore::vsphere' do - let :params do - { - :vmware_server_host => '10.0.0.1', - :vmware_server_username => 'root', - :vmware_server_password => '123456', - :vmware_datastores => 'Datacenter:Datastore', - :vmware_store_image_dir => '/openstack_glance', - } - end - - context 'when default parameters' do - it 'configures glance-api.conf' do - is_expected.to contain_glance_api_config('vsphere/store_description').with_value('') - is_expected.to contain_glance_api_config('vsphere/weight').with_value('') - is_expected.to contain_glance_api_config('vsphere/vmware_insecure').with_value('True') - is_expected.to contain_glance_api_config('vsphere/vmware_server_host').with_value('10.0.0.1') - is_expected.to contain_glance_api_config('vsphere/vmware_server_username').with_value('root') - is_expected.to contain_glance_api_config('vsphere/vmware_server_password').with_value('123456').with_secret(true) - is_expected.to contain_glance_api_config('vsphere/vmware_store_image_dir').with_value('/openstack_glance') - is_expected.to contain_glance_api_config('vsphere/vmware_task_poll_interval').with_value('') - is_expected.to contain_glance_api_config('vsphere/vmware_api_retry_count').with_value('') - is_expected.to contain_glance_api_config('vsphere/vmware_datastores').with_value('Datacenter:Datastore') - is_expected.to contain_glance_api_config('vsphere/vmware_ca_file').with_value('') - end - it 'configures glance-cache.conf' do - is_expected.to_not contain_glance_cache_config('vsphere/store_description') - is_expected.to contain_glance_cache_config('vsphere/weight').with_value('') - is_expected.to contain_glance_cache_config('vsphere/vmware_insecure').with_value('True') - is_expected.to contain_glance_cache_config('vsphere/vmware_server_host').with_value('10.0.0.1') - is_expected.to contain_glance_cache_config('vsphere/vmware_server_username').with_value('root') - is_expected.to contain_glance_cache_config('vsphere/vmware_server_password').with_value('123456').with_secret(true) - is_expected.to contain_glance_cache_config('vsphere/vmware_store_image_dir').with_value('/openstack_glance') - is_expected.to contain_glance_cache_config('vsphere/vmware_task_poll_interval').with_value('') - is_expected.to contain_glance_cache_config('vsphere/vmware_api_retry_count').with_value('') - is_expected.to contain_glance_cache_config('vsphere/vmware_datastores').with_value('Datacenter:Datastore') - is_expected.to contain_glance_cache_config('vsphere/vmware_ca_file').with_value('') - end - end - - context 'when overriding parameters' do - before do - params.merge!({ - :store_description => 'My vsphere store', - :weight => 0, - :vmware_ca_file => '/etc/glance/vcenter-ca.pem', - :vmware_task_poll_interval => '6', - :vmware_api_retry_count => '11', - }) - end - it 'configures glance-api.conf' do - is_expected.to contain_glance_api_config('vsphere/store_description').with_value('My vsphere store') - is_expected.to contain_glance_api_config('vsphere/weight').with_value(0) - is_expected.to contain_glance_api_config('vsphere/vmware_ca_file').with_value('/etc/glance/vcenter-ca.pem') - is_expected.to contain_glance_api_config('vsphere/vmware_task_poll_interval').with_value('6') - is_expected.to contain_glance_api_config('vsphere/vmware_api_retry_count').with_value('11') - end - it 'configures glance-cache.conf' do - is_expected.to_not contain_glance_cache_config('vsphere/store_description') - is_expected.to contain_glance_cache_config('vsphere/weight').with_value(0) - is_expected.to contain_glance_cache_config('vsphere/vmware_ca_file').with_value('/etc/glance/vcenter-ca.pem') - is_expected.to contain_glance_cache_config('vsphere/vmware_task_poll_interval').with_value('6') - is_expected.to contain_glance_cache_config('vsphere/vmware_api_retry_count').with_value('11') - end - end - end - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge!(OSDefaults.get_facts()) - end - - it_behaves_like 'glance::backend::multistore::vsphere' - end - end -end