From 0c8a033a03976d16b0cbbfa3959414e21890c7b6 Mon Sep 17 00:00:00 2001 From: Jianghua Wang Date: Tue, 5 Dec 2017 06:08:02 +0000 Subject: [PATCH] XenAPI: support XenAPI in nova configuration When using XenAPI as the virt driver, we need some XenAPI specific configure options. This commit is to ensure nova's configuration can be generated correctly for XenAPI. It includes the folowing changes: * Add XenAPI as one of the valid options for nova_compute_virt_type; * Configure some options when XenAPI is chosen as the virt type. This commit does NOT include the host and [vnc] configurations which will be covered by a following commit. References: * XenServer (and other XAPI based Xen variants): https://docs.openstack.org/nova/pike/admin/configuration/hypervisor-xen-api.html * XenCenter HIMN plugin (adding HIMN network which is used by XenAPI driver to communicate with XenServer): https://github.com/citrix-openstack/xencenter-himn-plugin * nova configuration options: https://docs.openstack.org/nova/pike/configuration/config.html Change-Id: Id34d247ab78976627f8e70685f27470b254cd418 blueprint: xenserver-support --- ansible/group_vars/all.yml | 11 ++++++++++- ansible/roles/nova/templates/nova.conf.j2 | 10 ++++++++++ etc/kolla/globals.yml | 11 ++++++++++- etc/kolla/passwords.yml | 5 +++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 3d70edf635..29f97bcb84 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -611,7 +611,7 @@ computes_need_external_bridge: "{{ enable_neutron_dvr | bool or enable_neutron_p ####################### nova_backend_ceph: "{{ enable_ceph }}" nova_backend: "{{ 'rbd' if nova_backend_ceph | bool else 'default' }}" -# Valid options are [ kvm, qemu, vmware ] +# Valid options are [ kvm, qemu, vmware, xenapi ] nova_compute_virt_type: "kvm" ####################### @@ -706,3 +706,12 @@ enable_opendaylight_legacy_netvirt_conntrack: "no" opendaylight_port_binding_type: "pseudo-agentdb-binding" opendaylight_features: "odl-mdsal-apidocs,odl-netvirt-openstack" opendaylight_allowed_network_types: '"flat", "vlan", "vxlan"' + +####################################### +# XenAPI - Support XenAPI for XenServer +####################################### +# XenAPI driver use HIMN(Host Internal Management Network) +# to communicate with XenServer host. +xenserver_himn_ip: "169.254.0.1" +xenserver_username: "root" +xenserver_connect_protocol: "https" diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index 62fa892b27..e4566e7dab 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -33,6 +33,8 @@ host = {{ ansible_hostname }}_{{ service_name }} compute_driver = fake.FakeDriver {% elif nova_compute_virt_type == 'vmware' %} compute_driver = vmwareapi.VMwareVCDriver +{% elif nova_compute_virt_type == 'xenapi' %} +compute_driver = xenapi.XenAPIDriver {% else %} compute_driver = libvirt.LibvirtDriver {% endif %} @@ -262,3 +264,11 @@ connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch [barbican] auth_endpoint = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }} {% endif %} + +{% if nova_compute_virt_type == "xenapi" %} +[xenserver] +ovs_integration_bridge = br-int +connection_password = {{ xenserver_password }} +connection_username = {{ xenserver_username }} +connection_url = {{ xenserver_connect_protocol }}://{{ xenserver_himn_ip }} +{% endif %} diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 570c66aee2..9234f576f7 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -328,7 +328,7 @@ kolla_internal_vip_address: "10.10.10.254" ######################## #nova_backend_ceph: "{{ enable_ceph }}" -# Valid options are [ qemu, kvm, vmware ] +# Valid options are [ qemu, kvm, vmware, xenapi ] #nova_compute_virt_type: "kvm" # The number of fake driver per compute node @@ -401,3 +401,12 @@ tempest_floating_network_name: #vmware_datastore_name: #vmware_vcenter_name: #vmware_vcenter_cluster_name: + +####################################### +# XenAPI - Support XenAPI for XenServer +####################################### +# XenAPI driver use HIMN(Host Internal Management Network) +# to communicate with XenServer host. +#xenserver_himn_ip: +#xenserver_username: +#xenserver_connect_protocol: diff --git a/etc/kolla/passwords.yml b/etc/kolla/passwords.yml index 1b659da29d..2a50e24153 100644 --- a/etc/kolla/passwords.yml +++ b/etc/kolla/passwords.yml @@ -221,3 +221,8 @@ etcd_cluster_token: # redis options #################### redis_master_password: + +################ +# XenAPI options +################ +xenserver_password: