Merge "XenServer hypervisor plugin"
This commit is contained in:
commit
016511c5f1
16
lib/nova
16
lib/nova
@ -76,15 +76,7 @@ SPICE_DIR=$DEST/spice-html5
|
|||||||
# --------------------------
|
# --------------------------
|
||||||
|
|
||||||
# Set defaults according to the virt driver
|
# Set defaults according to the virt driver
|
||||||
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
|
if [ "$VIRT_DRIVER" = 'baremetal' ]; then
|
||||||
PUBLIC_INTERFACE_DEFAULT=eth2
|
|
||||||
GUEST_INTERFACE_DEFAULT=eth1
|
|
||||||
# Allow ``build_domU.sh`` to specify the flat network bridge via kernel args
|
|
||||||
FLAT_NETWORK_BRIDGE_DEFAULT=$(sed -e 's/.* flat_network_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline)
|
|
||||||
if is_service_enabled neutron; then
|
|
||||||
XEN_INTEGRATION_BRIDGE=$(sed -e 's/.* xen_integration_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline)
|
|
||||||
fi
|
|
||||||
elif [ "$VIRT_DRIVER" = 'baremetal' ]; then
|
|
||||||
NETWORK_MANAGER=${NETWORK_MANAGER:-FlatManager}
|
NETWORK_MANAGER=${NETWORK_MANAGER:-FlatManager}
|
||||||
PUBLIC_INTERFACE_DEFAULT=eth0
|
PUBLIC_INTERFACE_DEFAULT=eth0
|
||||||
FLAT_INTERFACE=${FLAT_INTERFACE:-eth0}
|
FLAT_INTERFACE=${FLAT_INTERFACE:-eth0}
|
||||||
@ -535,16 +527,12 @@ function create_nova_conf() {
|
|||||||
SPICEHTML5PROXY_URL=${SPICEHTML5PROXY_URL:-"http://$SERVICE_HOST:6082/spice_auto.html"}
|
SPICEHTML5PROXY_URL=${SPICEHTML5PROXY_URL:-"http://$SERVICE_HOST:6082/spice_auto.html"}
|
||||||
iniset $NOVA_CONF spice html5proxy_base_url "$SPICEHTML5PROXY_URL"
|
iniset $NOVA_CONF spice html5proxy_base_url "$SPICEHTML5PROXY_URL"
|
||||||
fi
|
fi
|
||||||
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
|
|
||||||
VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=169.254.0.1}
|
|
||||||
else
|
|
||||||
VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=127.0.0.1}
|
|
||||||
fi
|
|
||||||
|
|
||||||
if is_service_enabled n-novnc || is_service_enabled n-xvnc; then
|
if is_service_enabled n-novnc || is_service_enabled n-xvnc; then
|
||||||
# Address on which instance vncservers will listen on compute hosts.
|
# Address on which instance vncservers will listen on compute hosts.
|
||||||
# For multi-host, this should be the management ip of the compute host.
|
# For multi-host, this should be the management ip of the compute host.
|
||||||
VNCSERVER_LISTEN=${VNCSERVER_LISTEN=127.0.0.1}
|
VNCSERVER_LISTEN=${VNCSERVER_LISTEN=127.0.0.1}
|
||||||
|
VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=127.0.0.1}
|
||||||
iniset $NOVA_CONF DEFAULT vnc_enabled true
|
iniset $NOVA_CONF DEFAULT vnc_enabled true
|
||||||
iniset $NOVA_CONF DEFAULT vncserver_listen "$VNCSERVER_LISTEN"
|
iniset $NOVA_CONF DEFAULT vncserver_listen "$VNCSERVER_LISTEN"
|
||||||
iniset $NOVA_CONF DEFAULT vncserver_proxyclient_address "$VNCSERVER_PROXYCLIENT_ADDRESS"
|
iniset $NOVA_CONF DEFAULT vncserver_proxyclient_address "$VNCSERVER_PROXYCLIENT_ADDRESS"
|
||||||
|
85
lib/nova_plugins/hypervisor-xenserver
Normal file
85
lib/nova_plugins/hypervisor-xenserver
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
# lib/nova_plugins/hypervisor-xenserver
|
||||||
|
# Configure the XenServer hypervisor
|
||||||
|
|
||||||
|
# Enable with:
|
||||||
|
# VIRT_DRIVER=xenserver
|
||||||
|
|
||||||
|
# Dependencies:
|
||||||
|
# ``functions`` file
|
||||||
|
# ``nova`` configuration
|
||||||
|
|
||||||
|
# install_nova_hypervisor - install any external requirements
|
||||||
|
# configure_nova_hypervisor - make configuration changes, including those to other services
|
||||||
|
# start_nova_hypervisor - start any external services
|
||||||
|
# stop_nova_hypervisor - stop any external services
|
||||||
|
# cleanup_nova_hypervisor - remove transient data and cache
|
||||||
|
|
||||||
|
# Save trace setting
|
||||||
|
MY_XTRACE=$(set +o | grep xtrace)
|
||||||
|
set +o xtrace
|
||||||
|
|
||||||
|
|
||||||
|
# Defaults
|
||||||
|
# --------
|
||||||
|
|
||||||
|
PUBLIC_INTERFACE_DEFAULT=eth2
|
||||||
|
GUEST_INTERFACE_DEFAULT=eth1
|
||||||
|
# Allow ``build_domU.sh`` to specify the flat network bridge via kernel args
|
||||||
|
FLAT_NETWORK_BRIDGE_DEFAULT=$(sed -e 's/.* flat_network_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline)
|
||||||
|
if is_service_enabled neutron; then
|
||||||
|
XEN_INTEGRATION_BRIDGE=$(sed -e 's/.* xen_integration_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline)
|
||||||
|
fi
|
||||||
|
|
||||||
|
VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=169.254.0.1}
|
||||||
|
|
||||||
|
|
||||||
|
# Entry Points
|
||||||
|
# ------------
|
||||||
|
|
||||||
|
# clean_nova_hypervisor - Clean up an installation
|
||||||
|
function cleanup_nova_hypervisor() {
|
||||||
|
# This function intentionally left blank
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
# configure_nova_hypervisor - Set config files, create data dirs, etc
|
||||||
|
function configure_nova_hypervisor() {
|
||||||
|
if [ -z "$XENAPI_CONNECTION_URL" ]; then
|
||||||
|
die $LINENO "XENAPI_CONNECTION_URL is not specified"
|
||||||
|
fi
|
||||||
|
read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
|
||||||
|
iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver"
|
||||||
|
iniset $NOVA_CONF DEFAULT xenapi_connection_url "$XENAPI_CONNECTION_URL"
|
||||||
|
iniset $NOVA_CONF DEFAULT xenapi_connection_username "$XENAPI_USER"
|
||||||
|
iniset $NOVA_CONF DEFAULT xenapi_connection_password "$XENAPI_PASSWORD"
|
||||||
|
iniset $NOVA_CONF DEFAULT flat_injected "False"
|
||||||
|
# Need to avoid crash due to new firewall support
|
||||||
|
XEN_FIREWALL_DRIVER=${XEN_FIREWALL_DRIVER:-"nova.virt.firewall.IptablesFirewallDriver"}
|
||||||
|
iniset $NOVA_CONF DEFAULT firewall_driver "$XEN_FIREWALL_DRIVER"
|
||||||
|
}
|
||||||
|
|
||||||
|
# install_nova_hypervisor() - Install external components
|
||||||
|
function install_nova_hypervisor() {
|
||||||
|
# This function intentionally left blank
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
# start_nova_hypervisor - Start any required external services
|
||||||
|
function start_nova_hypervisor() {
|
||||||
|
# This function intentionally left blank
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
# stop_nova_hypervisor - Stop any external services
|
||||||
|
function stop_nova_hypervisor() {
|
||||||
|
# This function intentionally left blank
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Restore xtrace
|
||||||
|
$MY_XTRACE
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# End:
|
19
stack.sh
19
stack.sh
@ -981,25 +981,6 @@ if is_service_enabled nova; then
|
|||||||
configure_nova_hypervisor
|
configure_nova_hypervisor
|
||||||
|
|
||||||
|
|
||||||
# XenServer
|
|
||||||
# ---------
|
|
||||||
|
|
||||||
elif [ "$VIRT_DRIVER" = 'xenserver' ]; then
|
|
||||||
echo_summary "Using XenServer virtualization driver"
|
|
||||||
if [ -z "$XENAPI_CONNECTION_URL" ]; then
|
|
||||||
die $LINENO "XENAPI_CONNECTION_URL is not specified"
|
|
||||||
fi
|
|
||||||
read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
|
|
||||||
iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver"
|
|
||||||
iniset $NOVA_CONF DEFAULT xenapi_connection_url "$XENAPI_CONNECTION_URL"
|
|
||||||
iniset $NOVA_CONF DEFAULT xenapi_connection_username "$XENAPI_USER"
|
|
||||||
iniset $NOVA_CONF DEFAULT xenapi_connection_password "$XENAPI_PASSWORD"
|
|
||||||
iniset $NOVA_CONF DEFAULT flat_injected "False"
|
|
||||||
# Need to avoid crash due to new firewall support
|
|
||||||
XEN_FIREWALL_DRIVER=${XEN_FIREWALL_DRIVER:-"nova.virt.firewall.IptablesFirewallDriver"}
|
|
||||||
iniset $NOVA_CONF DEFAULT firewall_driver "$XEN_FIREWALL_DRIVER"
|
|
||||||
|
|
||||||
|
|
||||||
# OpenVZ
|
# OpenVZ
|
||||||
# ------
|
# ------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user