From f12a4a6dad3016220dac4290b34eb6c1a77a0f1e Mon Sep 17 00:00:00 2001 From: shaofeng_cheng Date: Tue, 11 Jul 2017 09:49:37 +0800 Subject: [PATCH] Add VMware DataStore support to cinder Add VMware VMDK driver supports to cinder service. The VMware driver for OpenStack Block Storage is recommended and should be used for managing volumes based on vSphere data stores. see https://docs.openstack.org/ocata/config-reference/compute/hypervisor-vmware.html https://docs.openstack.org/ocata/config-reference/block-storage/drivers/vmware-vmdk-driver.html#block-storage-vmdk-driver Partially-implements: blueprint kolla-ansible-support-vsphere Change-Id: Ic3eb7ae34c1e8584945b3d97f8b427ee67ea8fba --- ansible/group_vars/all.yml | 2 ++ ansible/roles/cinder/defaults/main.yml | 2 ++ ansible/roles/cinder/templates/cinder.conf.j2 | 11 +++++++++++ etc/kolla/globals.yml | 2 ++ 4 files changed, 17 insertions(+) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 7eaacd14aa..d9cb635f88 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -507,6 +507,7 @@ gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}" # Cinder options ################################# cinder_backend_ceph: "{{ enable_ceph }}" +cinder_backend_vmwarevc_vmdk: "no" cinder_volume_group: "cinder-volumes" cinder_backup_driver: "nfs" cinder_backup_share: "" @@ -618,3 +619,4 @@ ceph_cache_rule: "cache host firstn" vmware_vcenter_host_ip: vmware_vcenter_host_username: vmware_vcenter_host_password: +vmware_vcenter_cluster_name: diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index 359d4cae74..84fabfc2c5 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -134,6 +134,8 @@ cinder_backends: enabled: "{{ enable_cinder_backend_hnas_iscsi | bool }}" - name: "hnas-nfs" enabled: "{{ enable_cinder_backend_hnas_nfs | bool }}" + - name: "vmwarevc-vmdk" + enabled: "{{ cinder_backend_vmwarevc_vmdk | bool }}" cinder_enabled_backends: "{{ cinder_backends|selectattr('enabled', 'equalto', true)|list }}" cinder_iscsi_helper: "tgtadm" diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index b5109d4d4a..64a12ddd52 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -154,6 +154,17 @@ hnas_svc0_volume_type = {{ hnas_nfs_svc0_volume_type }} hnas_svc0_hdp = {{ hnas_nfs_svc0_hdp }} {% endif %} +{% if cinder_backend_vmwarevc_vmdk | bool %} +[vmwarevc-vmdk] +volume_backend_name=vmwarevc-vmdk +volume_driver = cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver +vmware_host_ip = {{ vmware_vcenter_host_ip }} +vmware_host_username = {{ vmware_vcenter_host_username }} +vmware_host_password = {{ vmware_vcenter_host_password }} +vmware_cluster_name = {{ vmware_vcenter_cluster_name }} +vmware_insecure = True +{% endif %} + [privsep_entrypoint] helper_command=sudo cinder-rootwrap /etc/cinder/rootwrap.conf privsep-helper --config-file /etc/cinder/cinder.conf diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 17de9774a9..1cc4f22b7a 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -284,6 +284,7 @@ kolla_internal_vip_address: "10.10.10.254" ################################# # Enable / disable Cinder backends #cinder_backend_ceph: "{{ enable_ceph }}" +#cinder_backend_vmwarevc_vmdk: "no" #cinder_volume_group: "cinder-volumes" #cinder_backup_driver: "nfs" #cinder_backup_share: "" @@ -368,3 +369,4 @@ tempest_floating_network_name: #vmware_vcenter_host_password: #vmware_datastore_name: #vmware_vcenter_name: +#vmware_vcenter_cluster_name: