diff --git a/README.md b/README.md index 5deabb7..090aaee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,61 @@ -cloudgear +CloudGear ========= + +Here we are going to deploy openstack on a single node, i.e all openstack components Nova, Glance, Keystone, Quantum and Horizon will be running in the same box. Nova-compute is also running on the same machine which will provision virtual machines on the KVM. + +Requirements: + +* Ubuntu 12.04 running on Oracle VirtualBox with two NIC ‘s. + +* Setup a ubuntu virtual machine in virtualBox. (can follow Guide http://ilearnstack.wordpress.com/2013/04/13/setting-ubuntu-vm-in-virtualbox/) + +* Add a second NIC to the VM. + +* Power Off the Virtual Machine + +* In the Network Section select Adapter 2 tab + +* Select “Attached to:” to internal + +* Power On the VM + +* When the VM boots up configure to network for second NIC + Edit /etc/network/interfaces to something like + +* Restart Network service + service networking restart + +* You can verify your network setting using “ ifconfig ” + +Deploying Openstack +==================== + +* Login to the ubuntu VM. +* Change the user to root. + sudo -i + +* If your network is behind proxy then please export proxy variables. + export http_proxy= + export https_proxy= + export no_proxy=”localhost,127.0.0.1″ + +* Install git on the machine + apt-get install git -y + +* Clone the CloudGear git to install Openstack + git clone https://github.com/ilearnstack/cloudgear.git + +* Execute the script to set up openstack + cd cloudgear/ + python cloudgear.py + +* Open Openstack Dashboard in browser from URL http:///horizon + +* Login with credentials admin/secret + + +Link to the detailed description of Deployment +============================================== + +You can refer to the step by step guide at Our Blog http://ilearnstack.wordpress.com/2013/04/26/setting-up-a-single-node-openstack-environment/ +Please Post your Comments to the page or write to us at learnstack@googlegroups.com for any issues faced with the script. diff --git a/cloudgear.py b/cloudgear.py index 588c2f2..b1cc2db 100644 --- a/cloudgear.py +++ b/cloudgear.py @@ -6,13 +6,13 @@ import struct import socket import subprocess +import webbrowser # These are module names which are not installed by default. # These modules will be loaded later after downloading iniparse = None psutil = None - def kill_process(process_name): for proc in psutil.process_iter(): if proc.name == process_name: @@ -48,7 +48,6 @@ def add_to_conf(conf_file, section, param, val): with open(conf_file, 'w') as f: config.write(f) - def delete_from_conf(conf_file, section, param): config = iniparse.ConfigParser() config.readfp(open(conf_file)) @@ -59,7 +58,6 @@ def delete_from_conf(conf_file, section, param): with open(conf_file, 'w') as f: config.write(f) - def get_from_conf(conf_file, section, param): config = iniparse.ConfigParser() config.readfp(open(conf_file)) @@ -67,10 +65,14 @@ def get_from_conf(conf_file, section, param): raise Exception("parameter missing") else: return config.get(section, param) - + +def print_format(string): + print "+%s+" %("-" * len(string)) + print "|%s|" % string + print "+%s+" %("-" * len(string)) def execute(command, display=False): - print "executing commnand : %s " % command + print_format ("Executing : %s " % command) process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if display: while True: @@ -92,13 +94,11 @@ def execute(command, display=False): print "Error", stderr raise Exception(command, exitCode, output) - def execute_db_commnads(command): cmd = """mysql -uroot -e "%s" """ % command output = execute(cmd) return output - def initialize_system(): if not os.geteuid() == 0: sys.exit('Please re-run the script with root user') @@ -107,8 +107,8 @@ def initialize_system(): execute("apt-get autoclean -y" , True) execute("apt-get update -y" , True) execute("apt-get install ubuntu-cloud-keyring python-setuptools python-iniparse python-psutil -y", True) - delete_file("/etc/apt/sources.list.d/grizzly.list") - execute("echo deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main >> /etc/apt/sources.list.d/grizzly.list") + delete_file("/etc/apt/sources.list.d/havana.list") + execute("echo deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main >> /etc/apt/sources.list.d/havana.list") execute("apt-get update -y", True) global iniparse @@ -129,15 +129,12 @@ def install_rabbitmq(): execute("service rabbitmq-server restart", True) time.sleep(2) - def install_database(): execute("apt-get install mysql-server python-mysqldb -y", True) execute("sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf") execute("service mysql restart", True) time.sleep(2) - - def _create_keystone_users(): os.environ['SERVICE_TOKEN'] = 'ADMINTOKEN' os.environ['SERVICE_ENDPOINT'] = 'http://127.0.0.1:35357/v2.0' @@ -148,15 +145,12 @@ def _create_keystone_users(): admin_user = execute("keystone user-create --tenant_id %s --name admin --pass secret --enabled true|grep ' id '|awk '{print $4}'" % admin_tenant) admin_role = execute("keystone role-create --name admin|grep ' id '|awk '{print $4}'") execute("keystone user-role-add --user_id %s --tenant_id %s --role_id %s" % (admin_user, admin_tenant, admin_role)) - - + service_tenant = execute("keystone tenant-create --name service --description 'Service Tenant' --enabled true |grep ' id '|awk '{print $4}'") - #keystone keystone_service = execute("keystone service-create --name=keystone --type=identity --description='Keystone Identity Service'|grep ' id '|awk '{print $4}'") execute("keystone endpoint-create --region region --service_id=%s --publicurl=http://%s:5000/v2.0 --internalurl=http://127.0.0.1:5000/v2.0 --adminurl=http://127.0.0.1:35357/v2.0" % (keystone_service, ip_address)) - #Glance glance_user = execute("keystone user-create --tenant_id %s --name glance --pass glance --enabled true|grep ' id '|awk '{print $4}'" % service_tenant) @@ -165,7 +159,6 @@ def _create_keystone_users(): glance_service = execute("keystone service-create --name=glance --type=image --description='Glance Image Service'|grep ' id '|awk '{print $4}'") execute("keystone endpoint-create --region region --service_id=%s --publicurl=http://%s:9292/v2 --internalurl=http://127.0.0.1:9292/v2 --adminurl=http://127.0.0.1:9292/v2" % (glance_service, ip_address)) - #nova nova_user = execute("keystone user-create --tenant_id %s --name nova --pass nova --enabled true|grep ' id '|awk '{print $4}'" % service_tenant) execute("keystone user-role-add --user_id %s --tenant_id %s --role_id %s" % (nova_user, service_tenant, admin_role)) @@ -173,13 +166,12 @@ def _create_keystone_users(): nova_service = execute("keystone service-create --name=nova --type=compute --description='Nova Compute Service'|grep ' id '|awk '{print $4}'") execute("keystone endpoint-create --region region --service_id=%s --publicurl='http://%s:8774/v2/$(tenant_id)s' --internalurl='http://127.0.0.1:8774/v2/$(tenant_id)s' --adminurl='http://127.0.0.1:8774/v2/$(tenant_id)s'" % (nova_service, ip_address)) + #neutron + neutron_user = execute("keystone user-create --tenant_id %s --name neutron --pass neutron --enabled true|grep ' id '|awk '{print $4}'" % service_tenant) + execute("keystone user-role-add --user_id %s --tenant_id %s --role_id %s" % (neutron_user, service_tenant, admin_role)) - #quantum - quantum_user = execute("keystone user-create --tenant_id %s --name quantum --pass quantum --enabled true|grep ' id '|awk '{print $4}'" % service_tenant) - execute("keystone user-role-add --user_id %s --tenant_id %s --role_id %s" % (quantum_user, service_tenant, admin_role)) - - quantum_service = execute("keystone service-create --name=quantum --type=network --description='OpenStack Networking service'|grep ' id '|awk '{print $4}'") - execute("keystone endpoint-create --region region --service_id=%s --publicurl=http://%s:9696/ --internalurl=http://127.0.0.1:9696/ --adminurl=http://127.0.0.1:9696/" % (quantum_service, ip_address)) + neutron_service = execute("keystone service-create --name=neutron --type=network --description='OpenStack Networking service'|grep ' id '|awk '{print $4}'") + execute("keystone endpoint-create --region region --service_id=%s --publicurl=http://%s:9696/ --internalurl=http://127.0.0.1:9696/ --adminurl=http://127.0.0.1:9696/" % (neutron_service, ip_address)) #write a rc file adminrc = "/root/adminrc" @@ -189,8 +181,7 @@ def _create_keystone_users(): write_to_file(adminrc, "export OS_TENANT_NAME=admin\n") write_to_file(adminrc, "export OS_AUTH_URL=http://127.0.0.1:5000/v2.0\n") - - + def install_and_configure_keystone(): keystone_conf = "/etc/keystone/keystone.conf" @@ -200,8 +191,7 @@ def install_and_configure_keystone(): execute_db_commnads("GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';") execute("apt-get install keystone -y", True) - - + add_to_conf(keystone_conf, "DEFAULT", "admin_token", "ADMINTOKEN") add_to_conf(keystone_conf, "DEFAULT", "admin_port", 35357) add_to_conf(keystone_conf, "sql", "connection", "mysql://keystone:keystone@localhost/keystone") @@ -214,8 +204,6 @@ def install_and_configure_keystone(): time.sleep(3) _create_keystone_users() - - def install_and_configure_glance(): glance_api_conf = "/etc/glance/glance-api.conf" glance_registry_conf = "/etc/glance/glance-registry.conf" @@ -228,30 +216,26 @@ def install_and_configure_glance(): execute_db_commnads("GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';") execute("apt-get install glance -y", True) - - + add_to_conf(glance_api_paste_conf, "filter:authtoken", "auth_host", "127.0.0.1") add_to_conf(glance_api_paste_conf, "filter:authtoken", "auth_port", "35357") add_to_conf(glance_api_paste_conf, "filter:authtoken", "auth_protocol", "http") add_to_conf(glance_api_paste_conf, "filter:authtoken", "admin_tenant_name", "service") add_to_conf(glance_api_paste_conf, "filter:authtoken", "admin_user", "glance") add_to_conf(glance_api_paste_conf, "filter:authtoken", "admin_password", "glance") - - + add_to_conf(glance_registry_paste_conf, "filter:authtoken", "auth_host", "127.0.0.1") add_to_conf(glance_registry_paste_conf, "filter:authtoken", "auth_port", "35357") add_to_conf(glance_registry_paste_conf, "filter:authtoken", "auth_protocol", "http") add_to_conf(glance_registry_paste_conf, "filter:authtoken", "admin_tenant_name", "service") add_to_conf(glance_registry_paste_conf, "filter:authtoken", "admin_user", "glance") add_to_conf(glance_registry_paste_conf, "filter:authtoken", "admin_password", "glance") - - + add_to_conf(glance_api_conf, "DEFAULT", "sql_connection", "mysql://glance:glance@localhost/glance") add_to_conf(glance_api_conf, "paste_deploy", "flavor", "keystone") add_to_conf(glance_api_conf, "DEFAULT", "verbose", "true") add_to_conf(glance_api_conf, "DEFAULT", "debug", "true") - - + add_to_conf(glance_registry_conf, "DEFAULT", "sql_connection", "mysql://glance:glance@localhost/glance") add_to_conf(glance_registry_conf, "paste_deploy", "flavor", "keystone") add_to_conf(glance_registry_conf, "DEFAULT", "verbose", "true") @@ -261,57 +245,60 @@ def install_and_configure_glance(): execute("service glance-api restart", True) execute("service glance-registry restart", True) - +def install_and_configure_neutron(): + neutron_conf = "/etc/neutron/neutron.conf" + neutron_paste_conf = "/etc/neutron/api-paste.ini" + neutron_plugin_conf = "/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini" + neutron_dhcp_ini="/etc/neutron/dhcp_agent.ini" + neutron_l3_ini="/etc/neutron/l3_agent.ini" + + execute_db_commnads("DROP DATABASE IF EXISTS neutron;") + execute_db_commnads("CREATE DATABASE neutron;") + execute_db_commnads("GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';") + execute_db_commnads("GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';") + + execute("apt-get install openvswitch-switch openvswitch-datapath-dkms -y", True) -def install_and_configure_quantum(): - quantum_conf = "/etc/quantum/quantum.conf" - quantum_paste_conf = "/etc/quantum/api-paste.ini" - quantum_plugin_conf = "/etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini" - quantum_dhcp_conf = "/etc/quantum/dhcp_agent.ini" - - execute_db_commnads("DROP DATABASE IF EXISTS quantum;") - execute_db_commnads("CREATE DATABASE quantum;") - execute_db_commnads("GRANT ALL PRIVILEGES ON quantum.* TO 'quantum'@'%' IDENTIFIED BY 'quantum';") - execute_db_commnads("GRANT ALL PRIVILEGES ON quantum.* TO 'quantum'@'localhost' IDENTIFIED BY 'quantum';") - - execute("apt-get install quantum-server quantum-plugin-linuxbridge quantum-plugin-linuxbridge-agent quantum-dhcp-agent dnsmasq -y", True) - - add_to_conf(quantum_conf, "DEFAULT", "core_plugin", "quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2") - add_to_conf(quantum_conf, "DEFAULT", "verbose", "true") - add_to_conf(quantum_conf, "DEFAULT", "debug", "true") - add_to_conf(quantum_conf, "DEFAULT", "auth_strategy", "keystone") - add_to_conf(quantum_conf, "DEFAULT", "rabbit_host", "127.0.0.1") - add_to_conf(quantum_conf, "DEFAULT", "rabbit_port", "5672") - add_to_conf(quantum_conf, "DEFAULT", "allow_overlapping_ips", "False") - add_to_conf(quantum_conf, "DEFAULT", "root_helper", "sudo quantum-rootwrap /etc/quantum/rootwrap.conf") - - add_to_conf(quantum_paste_conf, "filter:authtoken", "auth_host", "127.0.0.1") - add_to_conf(quantum_paste_conf, "filter:authtoken", "auth_port", "35357") - add_to_conf(quantum_paste_conf, "filter:authtoken", "auth_protocol", "http") - add_to_conf(quantum_paste_conf, "filter:authtoken", "admin_tenant_name", "service") - add_to_conf(quantum_paste_conf, "filter:authtoken", "admin_user", "quantum") - add_to_conf(quantum_paste_conf, "filter:authtoken", "admin_password", "quantum") - - add_to_conf(quantum_plugin_conf, "DATABASE", "sql_connection", "mysql://quantum:quantum@localhost/quantum") - add_to_conf(quantum_plugin_conf, "LINUX_BRIDGE", "physical_interface_mappings", "physnet1:eth1") - add_to_conf(quantum_plugin_conf, "VLANS", "tenant_network_type", "vlan") - add_to_conf(quantum_plugin_conf, "VLANS", "network_vlan_ranges", "physnet1:1000:2999") - - add_to_conf(quantum_dhcp_conf, "DEFAULT", "interface_driver", "quantum.agent.linux.interface.BridgeInterfaceDriver") - add_to_conf(quantum_dhcp_conf, "DEFAULT", "use_namespaces", "False") - add_to_conf(quantum_dhcp_conf, "DEFAULT", "verbose", "true") - add_to_conf(quantum_dhcp_conf, "DEFAULT", "debug", "true") - - delete_file("/etc/quantum/plugin.ini") - execute("ln -s /etc/quantum/plugins/linuxbridge/linuxbridge_conf.ini /etc/quantum/plugin.ini") - execute("sed -i 's/\/etc\/quantum\/plugins\/openvswitch\/ovs_quantum_plugin.ini/\/etc\/quantum\/plugins\/linuxbridge\/linuxbridge_conf.ini/g' /etc/default/quantum-server") - - kill_process("dnsmasq") - - execute("service quantum-server restart", True) - execute("service quantum-plugin-linuxbridge-agent restart", True) - execute("service quantum-dhcp-agent restart", True) + execute("ovs-vsctl --may-exist add-br br-int") + execute("ovs-vsctl --may-exist add-br br-eth1") + execute("ovs-vsctl --may-exist add-port br-eth1 eth1") + execute("ovs-vsctl --may-exist add-br br-ex") + + execute("apt-get install neutron-server neutron-plugin-openvswitch neutron-plugin-openvswitch-agent neutron-dhcp-agent neutron-l3-agent neutron-metadata-agent -y", True) + + add_to_conf(neutron_conf, "DEFAULT", "core_plugin", "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2") + add_to_conf(neutron_conf, "DEFAULT", "verbose", "true") + add_to_conf(neutron_conf, "DEFAULT", "debug", "true") + add_to_conf(neutron_conf, "DEFAULT", "auth_strategy", "keystone") + add_to_conf(neutron_conf, "DEFAULT", "rabbit_host", "127.0.0.1") + add_to_conf(neutron_conf, "DEFAULT", "rabbit_port", "5672") + add_to_conf(neutron_conf, "DEFAULT", "allow_overlapping_ips", "False") + add_to_conf(neutron_conf, "DEFAULT", "root_helper", "sudo neutron-rootwrap /etc/neutron/rootwrap.conf") + + add_to_conf(neutron_paste_conf, "filter:authtoken", "auth_host", "127.0.0.1") + add_to_conf(neutron_paste_conf, "filter:authtoken", "auth_port", "35357") + add_to_conf(neutron_paste_conf, "filter:authtoken", "auth_protocol", "http") + add_to_conf(neutron_paste_conf, "filter:authtoken", "admin_tenant_name", "service") + add_to_conf(neutron_paste_conf, "filter:authtoken", "admin_user", "neutron") + add_to_conf(neutron_paste_conf, "filter:authtoken", "admin_password", "neutron") + + add_to_conf(neutron_plugin_conf, "DATABASE", "sql_connection", "mysql://neutron:neutron@localhost/neutron") + add_to_conf(neutron_plugin_conf, "OVS", "bridge_mappings", "physnet1:br-eth1") + add_to_conf(neutron_plugin_conf, "OVS", "tenant_network_type", "vlan") + add_to_conf(neutron_plugin_conf, "OVS", "network_vlan_ranges", "physnet1:1000:2999") + add_to_conf(neutron_plugin_conf, "OVS", "integration_bridge", "br-int") + add_to_conf(neutron_plugin_conf, "securitygroup", "firewall_driver", "neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver") + + add_to_conf(neutron_dhcp_ini, "DEFAULT", "interface_driver", "neutron.agent.linux.interface.OVSInterfaceDriver") + add_to_conf(neutron_dhcp_ini, "DEFAULT", "dhcp_driver", "neutron.agent.linux.dhcp.Dnsmasq") + + add_to_conf(neutron_l3_ini, "DEFAULT", "interface_driver", "neutron.agent.linux.interface.OVSInterfaceDriver") + + execute("service neutron-server restart", True) + execute("service neutron-plugin-openvswitch-agent restart", True) + execute("service neutron-dhcp-agent restart", True) + execute("service neutron-l3-agent restart", True) def install_and_configure_nova(): @@ -324,18 +311,16 @@ def install_and_configure_nova(): execute_db_commnads("GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova';") execute_db_commnads("GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';") - execute("apt-get install kvm libvirt-bin -y") + execute("apt-get install kvm libvirt-bin python-libvirt -y") execute("apt-get install nova-api nova-cert nova-scheduler nova-conductor nova-compute-kvm novnc nova-consoleauth nova-novncproxy -y", True) - add_to_conf(nova_paste_conf, "filter:authtoken", "auth_host", "127.0.0.1") add_to_conf(nova_paste_conf, "filter:authtoken", "auth_port", "35357") add_to_conf(nova_paste_conf, "filter:authtoken", "auth_protocol", "http") add_to_conf(nova_paste_conf, "filter:authtoken", "admin_tenant_name", "service") add_to_conf(nova_paste_conf, "filter:authtoken", "admin_user", "nova") add_to_conf(nova_paste_conf, "filter:authtoken", "admin_password", "nova") - - + add_to_conf(nova_conf, "DEFAULT", "logdir", "/var/log/nova") add_to_conf(nova_conf, "DEFAULT", "verbose", "true") add_to_conf(nova_conf, "DEFAULT", "debug", "true") @@ -343,31 +328,28 @@ def install_and_configure_nova(): add_to_conf(nova_conf, "DEFAULT", "rabbit_host", "127.0.0.1") add_to_conf(nova_conf, "DEFAULT", "sql_connection", "mysql://nova:nova@localhost/nova") add_to_conf(nova_conf, "DEFAULT", "glance_api_servers", "127.0.0.1:9292") - add_to_conf(nova_conf, "DEFAULT", "compute_driver", "libvirt.LibvirtDriver") add_to_conf(nova_conf, "DEFAULT", "dhcpbridge_flagfile", "/etc/nova/nova.conf") - add_to_conf(nova_conf, "DEFAULT", "firewall_driver", "nova.virt.libvirt.firewall.IptablesFirewallDriver") + add_to_conf(nova_conf, "DEFAULT", "firewall_driver", "nova.virt.firewall.NoopFirewallDriver") + add_to_conf(nova_conf, "DEFAULT", "security_group_api", "neutron") + add_to_conf(nova_conf, "DEFAULT", "libvirt_vif_driver", "nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver") add_to_conf(nova_conf, "DEFAULT", "root_helper", "sudo nova-rootwrap /etc/nova/rootwrap.conf") - add_to_conf(nova_conf, "DEFAULT", "compute_driver", "libvirt.LibvirtDriver") add_to_conf(nova_conf, "DEFAULT", "auth_strategy", "keystone") add_to_conf(nova_conf, "DEFAULT", "novnc_enabled", "true") add_to_conf(nova_conf, "DEFAULT", "novncproxy_base_url", "http://%s:6080/vnc_auto.html" % ip_address) add_to_conf(nova_conf, "DEFAULT", "novncproxy_port", "6080") add_to_conf(nova_conf, "DEFAULT", "vncserver_proxyclient_address", ip_address) add_to_conf(nova_conf, "DEFAULT", "vncserver_listen", "0.0.0.0") - add_to_conf(nova_conf, "DEFAULT", "network_api_class", "nova.network.quantumv2.api.API") - add_to_conf(nova_conf, "DEFAULT", "quantum_admin_username", "quantum") - add_to_conf(nova_conf, "DEFAULT", "quantum_admin_password", "quantum") - add_to_conf(nova_conf, "DEFAULT", "quantum_admin_tenant_name", "service") - add_to_conf(nova_conf, "DEFAULT", "quantum_admin_auth_url", "http://127.0.0.1:5000/v2.0/") - add_to_conf(nova_conf, "DEFAULT", "quantum_auth_strategy", "keystone") - add_to_conf(nova_conf, "DEFAULT", "quantum_url", "http://127.0.0.1:9696/") - add_to_conf(nova_conf, "DEFAULT", "linuxnet_interface_driver", "nova.network.linux_net.QuantumLinuxBridgeInterfaceDriver") - - + add_to_conf(nova_conf, "DEFAULT", "network_api_class", "nova.network.neutronv2.api.API") + add_to_conf(nova_conf, "DEFAULT", "neutron_admin_username", "neutron") + add_to_conf(nova_conf, "DEFAULT", "neutron_admin_password", "neutron") + add_to_conf(nova_conf, "DEFAULT", "neutron_admin_tenant_name", "service") + add_to_conf(nova_conf, "DEFAULT", "neutron_admin_auth_url", "http://127.0.0.1:5000/v2.0/") + add_to_conf(nova_conf, "DEFAULT", "neutron_auth_strategy", "keystone") + add_to_conf(nova_conf, "DEFAULT", "neutron_url", "http://127.0.0.1:9696/") + add_to_conf(nova_compute_conf, "DEFAULT", "libvirt_type", "qemu") add_to_conf(nova_compute_conf, "DEFAULT", "compute_driver", "libvirt.LibvirtDriver") add_to_conf(nova_compute_conf, "DEFAULT", "libvirt_vif_type", "ethernet") - add_to_conf(nova_compute_conf, "DEFAULT", "libvirt_vif_driver", "nova.virt.libvirt.vif.QuantumLinuxBridgeVIFDriver") execute("nova-manage db sync") @@ -386,11 +368,21 @@ def install_and_configure_dashboard(): execute("apt-get install openstack-dashboard -y", True) execute("service apache2 restart", True) +def launch_horizon(): + url = 'http://localhost/horizon' + if sys.platform == 'Linux': + subprocess.Popen(['open', url]) + else: + webbrowser.open_new_tab(url) + initialize_system() install_rabbitmq() install_database() install_and_configure_keystone() install_and_configure_glance() -install_and_configure_quantum() +install_and_configure_neutron() install_and_configure_nova() -install_and_configure_dashboard() \ No newline at end of file +install_and_configure_dashboard() +print_format(" Installation successfull! Login into horizon http://%s/horizon Username:admin Password:secret " % ip_address) +print_format(" Please wait while script open your browser") +launch_horizon()