Browse code

vSphere hypervisor plugin

Convert vSphere hypervisor configuration in Nova to the new plugin setup.

Change-Id: Ibf6f5918e6a8d8a7b7784dac832d806e993cff8f

Dean Troyer authored on 2013/09/24 03:56:19
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,72 @@
0
+# lib/nova_plugins/hypervisor-vsphere
1
+# Configure the vSphere hypervisor
2
+
3
+# Enable with:
4
+# VIRT_DRIVER=vsphere
5
+
6
+# Dependencies:
7
+# ``functions`` file
8
+# ``nova`` configuration
9
+
10
+# install_nova_hypervisor - install any external requirements
11
+# configure_nova_hypervisor - make configuration changes, including those to other services
12
+# start_nova_hypervisor - start any external services
13
+# stop_nova_hypervisor - stop any external services
14
+# cleanup_nova_hypervisor - remove transient data and cache
15
+
16
+# Save trace setting
17
+MY_XTRACE=$(set +o | grep xtrace)
18
+set +o xtrace
19
+
20
+
21
+# Defaults
22
+# --------
23
+
24
+
25
+# Entry Points
26
+# ------------
27
+
28
+# clean_nova_hypervisor - Clean up an installation
29
+function cleanup_nova_hypervisor() {
30
+    # This function intentionally left blank
31
+    :
32
+}
33
+
34
+# configure_nova_hypervisor - Set config files, create data dirs, etc
35
+function configure_nova_hypervisor() {
36
+    iniset $NOVA_CONF DEFAULT compute_driver "vmwareapi.VMwareVCDriver"
37
+    VMWAREAPI_USER=${VMWAREAPI_USER:-"root"}
38
+    iniset $NOVA_CONF vmware host_ip "$VMWAREAPI_IP"
39
+    iniset $NOVA_CONF vmware host_username "$VMWAREAPI_USER"
40
+    iniset $NOVA_CONF vmware host_password "$VMWAREAPI_PASSWORD"
41
+    iniset $NOVA_CONF vmware cluster_name "$VMWAREAPI_CLUSTER"
42
+    if is_service_enabled neutron; then
43
+        iniset $NOVA_CONF vmware integration_bridge $OVS_BRIDGE
44
+    fi
45
+}
46
+
47
+# install_nova_hypervisor() - Install external components
48
+function install_nova_hypervisor() {
49
+    # This function intentionally left blank
50
+    :
51
+}
52
+
53
+# start_nova_hypervisor - Start any required external services
54
+function start_nova_hypervisor() {
55
+    # This function intentionally left blank
56
+    :
57
+}
58
+
59
+# stop_nova_hypervisor - Stop any external services
60
+function stop_nova_hypervisor() {
61
+    # This function intentionally left blank
62
+    :
63
+}
64
+
65
+
66
+# Restore xtrace
67
+$MY_XTRACE
68
+
69
+# Local variables:
70
+# mode: shell-script
71
+# End:
... ...
@@ -1089,22 +1089,6 @@ if is_service_enabled nova; then
1089 1089
         iniset $NOVA_CONF DEFAULT powervm_img_local_path $POWERVM_IMG_LOCAL_PATH
1090 1090
 
1091 1091
 
1092
-    # vSphere API
1093
-    # -----------
1094
-
1095
-    elif [ "$VIRT_DRIVER" = 'vsphere' ]; then
1096
-        echo_summary "Using VMware vCenter driver"
1097
-        iniset $NOVA_CONF DEFAULT compute_driver "vmwareapi.VMwareVCDriver"
1098
-        VMWAREAPI_USER=${VMWAREAPI_USER:-"root"}
1099
-        iniset $NOVA_CONF vmware host_ip "$VMWAREAPI_IP"
1100
-        iniset $NOVA_CONF vmware host_username "$VMWAREAPI_USER"
1101
-        iniset $NOVA_CONF vmware host_password "$VMWAREAPI_PASSWORD"
1102
-        iniset $NOVA_CONF vmware cluster_name "$VMWAREAPI_CLUSTER"
1103
-        if is_service_enabled neutron; then
1104
-            iniset $NOVA_CONF vmware integration_bridge $OVS_BRIDGE
1105
-        fi
1106
-
1107
-
1108 1092
     # Default libvirt
1109 1093
     # ---------------
1110 1094