Remove support for vmwareapi virt driver

... because the driver is being removed[1].

[1] https://review.opendev.org/c/openstack/nova/+/897017

Change-Id: Ie01893ab357b06976be3cce923163e44c0445291
This commit is contained in:
Takashi Kajinami 2023-10-31 11:53:55 +09:00
parent 29378852ad
commit 1d0bee66fc
4 changed files with 4 additions and 185 deletions

View File

@ -1,101 +0,0 @@
# == Class: nova::compute::vmware
#
# Configure the VMware compute driver for nova.
#
# === Parameters
#
# [*host_ip*]
# The IP address of the VMware vCenter server.
#
# [*host_username*]
# The username for connection to VMware vCenter server.
#
# [*host_password*]
# The password for connection to VMware vCenter server.
#
# [*cluster_name*]
# The name of a vCenter cluster compute resource.
#
# [*api_retry_count*]
# (optional) The number of times we retry on failures,
# e.g., socket error, etc.
# Defaults to $facts['os_service_default'].
#
# [*maximum_objects*]
# (optional) The maximum number of ObjectContent data objects that should
# be returned in a single result. A positive value will cause
# the operation to suspend the retrieval when the count of
# objects reaches the specified maximum. The server may still
# limit the count to something less than the configured value.
# Any remaining objects may be retrieved with additional requests.
# Defaults to $facts['os_service_default'].
#
# [*task_poll_interval*]
# (optional) The interval in seconds used for polling of remote tasks.
# Defaults to $facts['os_service_default'].
#
# [*use_linked_clone*]
# (optional) Whether to use linked clone strategy while creating VM's.
# Defaults to $facts['os_service_default'].
#
# [*compute_driver*]
# (optional) Compute driver.
# Defaults to 'vmwareapi.VMwareVCDriver'
#
# [*insecure*]
# (optional) Allow insecure connections.
# If true, the vCenter server certificate is not verified. If
# false, then the default CA truststore is used for verification. This
# option is ignored if 'ca_file' is set.
# Defaults to $facts['os_service_default']
#
# [*ca_file*]
# (optional) Specify a CA bundle file to use in verifying the vCenter server
# certificate.
# Defaults to $facts['os_service_default']
#
# [*datastore_regex*]
# (optional) Regex to match the name of a datastore.
# Defaults to $facts['os_service_default']
#
class nova::compute::vmware(
$host_ip,
$host_username,
$host_password,
$cluster_name,
$api_retry_count = $facts['os_service_default'],
$maximum_objects = $facts['os_service_default'],
$task_poll_interval = $facts['os_service_default'],
$use_linked_clone = $facts['os_service_default'],
$compute_driver = 'vmwareapi.VMwareVCDriver',
$insecure = $facts['os_service_default'],
$ca_file = $facts['os_service_default'],
$datastore_regex = $facts['os_service_default'],
) {
include nova::deps
include nova::params
warning('Support for vmwareapi virt driver has been deprecated.')
nova_config {
'DEFAULT/compute_driver': value => $compute_driver;
'vmware/host_ip': value => $host_ip;
'vmware/host_username': value => $host_username;
'vmware/host_password': value => $host_password, secret => true;
'vmware/cluster_name': value => $cluster_name;
'vmware/api_retry_count': value => $api_retry_count;
'vmware/maximum_objects': value => $maximum_objects;
'vmware/task_poll_interval': value => $task_poll_interval;
'vmware/use_linked_clone': value => $use_linked_clone;
'vmware/insecure': value => $insecure;
'vmware/ca_file': value => $ca_file;
'vmware/datastore_regex': value => $datastore_regex;
}
package { 'python-oslo-vmware':
ensure => present,
name => $::nova::params::oslo_vmware_package_name,
tag => ['openstack', 'nova-support-package'],
}
}

View File

@ -33,7 +33,6 @@ class nova::params {
$serialproxy_package_name = 'openstack-nova-serialproxy'
$spicehtml5proxy_package_name = 'openstack-nova-console'
$ceph_client_package_name = 'ceph-common'
$oslo_vmware_package_name = 'python3-oslo-vmware'
$mkisofs_package_name = 'xorriso'
$mkisofs_cmd = 'mkisofs'
# service names
@ -82,7 +81,6 @@ class nova::params {
$scheduler_package_name = 'nova-scheduler'
$tgt_package_name = 'tgt'
$ceph_client_package_name = 'ceph-common'
$oslo_vmware_package_name = 'python3-oslo-vmware'
$mkisofs_package_name = 'genisoimage'
$mkisofs_cmd = false
# service names

View File

@ -0,0 +1,4 @@
---
upgrade:
- |
Suopport for vmwareapi virt driver has been removed.

View File

@ -1,82 +0,0 @@
require 'spec_helper'
describe 'nova::compute::vmware' do
let :params do
{
:host_ip => '127.0.0.1',
:host_username => 'root',
:host_password => 'passw0rd',
:cluster_name => 'cluster1'
}
end
let :optional_params do
{
:api_retry_count => 10,
:maximum_objects => 100,
:task_poll_interval => 10.5,
:use_linked_clone => false,
:compute_driver => 'vmwareapi.FoobarDriver',
:insecure => true,
:datastore_regex => '/(?:[^:]|:[^:])+/'
}
end
shared_examples_for 'vmware api' do
context 'with default parameters' do
it 'configures vmwareapi in nova.conf' do
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('vmwareapi.VMwareVCDriver')
is_expected.to contain_nova_config('vmware/host_ip').with_value(params[:host_ip])
is_expected.to contain_nova_config('vmware/host_username').with_value(params[:host_username])
is_expected.to contain_nova_config('vmware/host_password').with_value(params[:host_password]).with_secret(true)
is_expected.to contain_nova_config('vmware/cluster_name').with_value(params[:cluster_name])
is_expected.to contain_nova_config('vmware/api_retry_count').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('vmware/maximum_objects').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('vmware/task_poll_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('vmware/use_linked_clone').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('vmware/insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('vmware/ca_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('vmware/datastore_regex').with_value('<SERVICE DEFAULT>')
end
it 'installs oslo.vmware python package' do
is_expected.to contain_package('python-oslo-vmware').with(
:ensure => 'present',
:name => 'python3-oslo-vmware',
:tag => ['openstack', 'nova-support-package'],
)
end
end
context 'with optional parameters' do
before :each do
params.merge!(optional_params)
end
it 'configures vmwareapi in nova.conf' do
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value(params[:compute_driver])
is_expected.to contain_nova_config('vmware/api_retry_count').with_value(params[:api_retry_count])
is_expected.to contain_nova_config('vmware/maximum_objects').with_value(params[:maximum_objects])
is_expected.to contain_nova_config('vmware/task_poll_interval').with_value(params[:task_poll_interval])
is_expected.to contain_nova_config('vmware/use_linked_clone').with_value(params[:use_linked_clone])
is_expected.to contain_nova_config('vmware/insecure').with_value(params[:insecure])
is_expected.to contain_nova_config('vmware/datastore_regex').with_value(params[:datastore_regex])
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 'vmware api'
end
end
end