def configure_ovs_plugin_vlan(vlan_start='1', vlan_end='4094', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='neutron'): sudo('echo [database] >> %s' % OVS_PLUGIN_CONF) utils.set_option(OVS_PLUGIN_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='database') utils.set_option(OVS_PLUGIN_CONF, 'reconnect_interval', '2', section='database') utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_type', 'vlan', section='ovs') utils.set_option(OVS_PLUGIN_CONF, 'network_vlan_ranges', 'physnet1:%s:%s' % (vlan_start, vlan_end), section='ovs') utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo /usr/bin/quantum-rootwrap ' '/etc/quantum/rootwrap.conf', section='agent') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup')
def configure_ovs_plugin_vlan(iface_bridge='eth1', br_postfix='eth1', vlan_start='1', vlan_end='4094', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='quantum'): utils.set_option(OVS_PLUGIN_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'reconnect_interval', '2', section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_type', 'vlan', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'network_vlan_ranges', 'physnet1:%s:%s' % (vlan_start, vlan_end), section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'bridge_mappings', 'physnet1:br-%s' % iface_bridge, section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo /usr/bin/quantum-rootwrap ' '/etc/quantum/rootwrap.conf', section='AGENT') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') with settings(warn_only=True): sudo('ovs-vsctl del-br br-%s' % br_postfix) sudo('ovs-vsctl add-br br-%s' % br_postfix) sudo('ovs-vsctl add-port br-%s %s' % (br_postfix, iface_bridge)) openvswitch_start() quantum_plugin_openvswitch_agent_start()
def configure_ovs_plugin_vlan(br_postfix='bond-vm', vlan_start='2', vlan_end='4094', neutron_mysql_username='******', neutron_mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', neutron_mysql_schema='neutron'): sudo('echo [database] >> %s' % OVS_PLUGIN_CONF) utils.set_option(OVS_PLUGIN_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, neutron_mysql_password, mysql_port, neutron_mysql_schema, neutron_mysql_username), section='database') utils.set_option(OVS_PLUGIN_CONF, 'reconnect_interval', '2', section='database') utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_type', 'vlan', section='ovs') utils.set_option(OVS_PLUGIN_CONF, 'network_vlan_ranges', 'physnet1:%s:%s' % (vlan_start, vlan_end), section='ovs') utils.set_option(OVS_PLUGIN_CONF, 'bridge_mappings', 'physnet1:br-%s' % br_postfix, section='ovs') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') # agent section utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf', section='agent') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') neutron_plugin_openvswitch_agent_start()
def configure_ovs_plugin_gre(ip_tunnel='127.0.0.1', tunnel_start='1', tunnel_end='1000', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='neutron'): utils.set_option(OVS_PLUGIN_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'reconnect_interval', '2', section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_type', 'gre', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'tunnel_id_ranges', '%s:%s' % (tunnel_start, tunnel_end), section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'local_ip', ip_tunnel, section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'integration_bridge', 'br-int', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'tunnel_bridge', 'br-tun', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'enable_tunneling', 'True', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo /usr/bin/neutron-rootwrap ' '/etc/neutron/rootwrap.conf', section='AGENT') #utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', # 'neutron.agent.linux.iptables_firewall.' # 'OVSHybridIptablesFirewallDriver', # section='securitygroup') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') openvswitch_start() neutron_plugin_openvswitch_agent_start()
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_password='******', rabbit_host='127.0.0.1', mysql_username='******', mysql_password='******', mysql_schema='neutron', mysql_host='127.0.0.1', mysql_port='3306'): utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' #utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_uri', # auth_uri, section='filter:authtoken') utils.set_option(NEUTRON_CONF, 'fake_rabbit', 'False') utils.set_option(NEUTRON_CONF, 'rabbit_password', rabbit_password) utils.set_option(NEUTRON_CONF, 'rabbit_host', rabbit_host) utils.set_option(NEUTRON_CONF, 'notification_driver', 'neutron.openstack.common.notifier.rpc_notifier') utils.set_option(NEUTRON_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NEUTRON_CONF, 'default_notification_level', 'INFO') # Configurtin LBAAS service # Add L3Router Plugin for ML2 plugin #utils.set_option(NEUTRON_CONF, 'service_plugins', # 'neutron.services.loadbalancer.plugin.LoadBalancerPlugin, ' # 'neutron.services.firewall.fwaas_plugin.FirewallPlugin, ' # 'neutron.services.l3_router.' # 'l3_router_plugin.L3RouterPlugin') utils.set_option(NEUTRON_CONF, 'service_plugins', 'neutron.services.loadbalancer.plugin.LoadBalancerPlugin') cp = 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2' #cp = 'neutron.plugins.ml2.plugin.Ml2Plugin' utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'connection', utils.sql_connect_string( mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='database') utils.set_option(NEUTRON_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_url', auth_uri, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'allow_overlapping_ips', 'True')
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_password='******', rabbit_host='127.0.0.1', mysql_username='******', mysql_password='******', mysql_schema='neutron', mysql_host='127.0.0.1', mysql_port='3306'): utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') auth_uri = 'http://' + auth_host + ':5000' utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_uri', auth_uri, section='filter:authtoken') cp = 'neutron.plugins.ml2.plugin.Ml2Plugin' utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'auth_strategy', 'keystone') utils.set_option(NEUTRON_CONF, 'fake_rabbit', 'False') utils.set_option(NEUTRON_CONF, 'rabbit_password', rabbit_password) utils.set_option(NEUTRON_CONF, 'rabbit_host', rabbit_host) utils.set_option(NEUTRON_CONF, 'notification_driver', 'neutron.openstack.common.notifier.rpc_notifier') utils.set_option(NEUTRON_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NEUTRON_CONF, 'default_notification_level', 'INFO') utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'connection', utils.sql_connect_string( mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='database') utils.set_option(NEUTRON_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'allow_overlapping_ips', 'True') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') utils.set_option(NEUTRON_CONF, 'quota_driver', 'neutron.db.quota_db.DbQuotaDriver', section='quotas')
def set_config_file(service_user='******', service_pass='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', mysql_username='******', mysql_password='******', mysql_schema='cinder', service_tenant_name='service', mysql_host='127.0.0.1', mysql_port='3306', storage_type='lvm', nfs_shares=None, nfs_sparsed_volumes=True, nfs_shares_config="/var/lib/cinder/nfsshare.conf", rabbit_password='******', rabbit_host='localhost'): utils.set_option(CINDER_CONF, 'rootwrap_config', '/etc/cinder/rootwrap.conf') utils.set_option(CINDER_CONF, 'auth_strategy', 'keystone') utils.set_option(CINDER_CONF, 'iscsi_helper', 'tgtadm') utils.set_option(CINDER_CONF, 'rabbit_password', rabbit_password) utils.set_option(CINDER_CONF, 'rabbit_host', rabbit_host) utils.set_option(CINDER_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username)) utils.set_option(CINDER_CONF, 'verbose', 'true') utils.set_option(CINDER_CONF, 'volume_group', 'cinder-volumes') utils.set_option(CINDER_CONF, 'log_dir', '/var/log/cinder') utils.set_option(CINDER_CONF, 'notification_driver', 'cinder.openstack.common.notifier.rabbit_notifier') utils.set_option(CINDER_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(CINDER_CONF, 'default_notification_level', 'INFO') '''Check storage types, TODO: Add more storages types ''' if storage_type == "nfs": ''' Write the list with nfs storage list ''' shared_nfs_list = nfs_shares.split(',') for nfs_share in shared_nfs_list: sudo("echo \"%s\" >> %s" % (nfs_share, nfs_shares_config)) sudo("chown cinder:cinder %s" % (nfs_shares_config)) utils.set_option(CINDER_CONF, 'volume_driver', 'cinder.volume.nfs.NfsDriver') utils.set_option(CINDER_CONF, 'nfs_shares_config', nfs_shares_config) utils.set_option(CINDER_CONF, 'nfs_mount_point_base', '/var/lib/cinder/volumes/') utils.set_option(CINDER_CONF, 'nfs_disk_util', 'df') utils.set_option(CINDER_CONF, 'nfs_sparsed_volumes', nfs_sparsed_volumes) utils.set_option(CINDER_API_PASTE_CONF, 'admin_tenant_name', service_tenant_name, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'admin_user', service_user, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'admin_password', service_pass, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') sudo('cinder-manage db sync')
def configure_ml2_plugin_vlan(iface_bridge='eth1', br_postfix='eth1', vlan_start='1', vlan_end='4094', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='neutron'): # TODO Fix that when ml2-neutron-plugin will be added in icehouse sudo('mkdir -p /etc/neutron/plugins/ml2') sudo('ln -s %s %s' %(OVS_PLUGIN_CONF, ML2_PLUGIN_CONF)) sudo('echo "''" > %s' % OVS_PLUGIN_CONF) sudo('echo [ml2] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ml2_type_vlan] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ovs] >> %s' % OVS_PLUGIN_CONF) sudo('echo [database] >> %s' % OVS_PLUGIN_CONF) sudo('echo [securitygroup] >> %s' % OVS_PLUGIN_CONF) sudo('echo [agent] >> %s' % OVS_PLUGIN_CONF) # ML2 section utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_types', 'vlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'type_drivers', 'local,flat,vlan,gre,vxlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'mechanism_drivers', 'openvswitch,linuxbridge', section='ml2') # ml2_type_vlan section utils.set_option(OVS_PLUGIN_CONF, 'network_vlan_ranges', 'physnet1:%s:%s' % (vlan_start, vlan_end), section='ml2_type_vlan') utils.set_option(OVS_PLUGIN_CONF, 'bridge_mappings', 'physnet1:br-%s' % br_postfix, section='ovs') # database section utils.set_option(OVS_PLUGIN_CONF, 'connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='database') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') # agent section utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf', section='agent') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') with settings(warn_only=True): sudo('ovs-vsctl del-br br-%s' % br_postfix) sudo('ovs-vsctl add-br br-%s' % br_postfix) sudo('ovs-vsctl add-port br-%s %s' % (br_postfix, iface_bridge)) openvswitch_start() neutron_plugin_openvswitch_agent_start()
def configure_neutron(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_password='******', rabbit_host='127.0.0.1', neutron_mysql_username='******', neutron_mysql_password='******', neutron_mysql_schema='neutron', mysql_host='127.0.0.1', mysql_port='3306'): #cp = 'neutron.plugins.ml2.plugin.Ml2Plugin' cp = 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2' utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'auth_strategy', 'keystone') utils.set_option(NEUTRON_CONF, 'fake_rabbit', 'False') utils.set_option(NEUTRON_CONF, 'rabbit_password', rabbit_password) utils.set_option(NEUTRON_CONF, 'rabbit_host', rabbit_host) utils.set_option(NEUTRON_CONF, 'notification_driver', 'nova.openstack.common.notifier.rpc_notifier') utils.set_option(NEUTRON_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NEUTRON_CONF, 'default_notification_level', 'INFO') utils.set_option(NEUTRON_CONF, 'connection', utils.sql_connect_string( mysql_host, neutron_mysql_password, mysql_port, neutron_mysql_schema, neutron_mysql_username), section='database') utils.set_option(NEUTRON_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' utils.set_option(NEUTRON_CONF, 'auth_url', auth_uri, section='keystone_authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') neutron_plugin_openvswitch_agent_start()
def configure_ml2_plugin_vxlan(neutron_mysql_username='******', neutron_mysql_password='******', neutron_mysql_host='127.0.0.1', neutron_mysql_port='3306', neutron_mysql_schema='neutron', local_ip='127.0.0.1'): # TODO Fix that when ml2-neutron-plugin will be added in icehouse sudo('mkdir -p /etc/neutron/plugins/ml2') with settings(warn_only=True): sudo('ln -s %s %s' % (OVS_PLUGIN_CONF, ML2_PLUGIN_CONF)) sudo('echo "''" > %s' % OVS_PLUGIN_CONF) sudo('echo [ml2] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ovs] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ml2_type_vxlan] >> %s' % OVS_PLUGIN_CONF) sudo('echo [database] >> %s' % OVS_PLUGIN_CONF) sudo('echo [securitygroup] >> %s' % OVS_PLUGIN_CONF) sudo('echo [agent] >> %s' % OVS_PLUGIN_CONF) # ML2 section utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_types', 'vxlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'type_drivers', 'local,flat,vlan,gre,vxlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'mechanism_drivers', 'openvswitch,linuxbridge', section='ml2') # ml2_type_vxlan section utils.set_option(OVS_PLUGIN_CONF, 'vni_ranges', '1:1000', section='ml2_type_vxlan') # ovs section utils.set_option(OVS_PLUGIN_CONF, 'local_ip', local_ip, section='ovs') utils.set_option(OVS_PLUGIN_CONF, 'enable_tunneling', 'True', section='ovs') # database section utils.set_option(OVS_PLUGIN_CONF, 'connection', utils.sql_connect_string(neutron_mysql_host, neutron_mysql_password, neutron_mysql_port, neutron_mysql_schema, neutron_mysql_username), section='database') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') # agent section utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo neutron-rootwrap ' '/etc/neutron/rootwrap.conf', section='agent') utils.set_option(OVS_PLUGIN_CONF, 'tunnel_types', 'vxlan', section='agent') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') neutron_plugin_openvswitch_agent_start()
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='cinder', tenant='service', rabbit_password='******', rabbit_host='localhost', iscsi_ip_address='127.0.0.1'): utils.set_option(CINDER_CONF, 'rootwrap_config', '/etc/cinder/rootwrap.conf') utils.set_option(CINDER_CONF, 'auth_strategy', 'keystone') utils.set_option(CINDER_CONF, 'iscsi_helper', 'tgtadm') utils.set_option(CINDER_CONF, 'rpc_backend', 'cinder.openstack.common.rpc.impl_kombu') utils.set_option(CINDER_CONF, 'rabbit_password', rabbit_password) utils.set_option(CINDER_CONF, 'rabbit_host', rabbit_host) utils.set_option(CINDER_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username)) utils.set_option(CINDER_CONF, 'verbose', 'true') utils.set_option(CINDER_CONF, 'api_paste_config', '/etc/cinder/api-paste.ini') utils.set_option(CINDER_CONF, 'volume_group', 'cinder-volumes') utils.set_option(CINDER_CONF, 'iscsi_ip_address', iscsi_ip_address) utils.set_option(CINDER_CONF, 'log_dir', '/var/log/cinder') utils.set_option(CINDER_CONF, 'notification_driver', 'cinder.openstack.common.notifier.rpc_notifier') utils.set_option(CINDER_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(CINDER_CONF, 'default_notification_level', 'INFO') # Check storage types, TODO: Add more storages types ''' utils.set_option(CINDER_CONF, 'scheduler_driver', 'cinder.scheduler.filter_scheduler.FilterScheduler') utils.set_option(CINDER_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' utils.set_option(CINDER_API_PASTE_CONF, 'auth_uri', auth_uri, section='filter:authtoken') sudo('cinder-manage db sync')
def configure_ovs_plugin_gre(local_ip=None, neutron_mysql_username='******', neutron_mysql_password='******', neutron_mysql_host='127.0.0.1', neutron_mysql_port='3306', neutron_mysql_schema='neutron'): utils.set_option(OVS_PLUGIN_CONF, 'sql_connection', utils.sql_connect_string(neutron_mysql_host, neutron_mysql_password, neutron_mysql_port, neutron_mysql_schema, neutron_mysql_username), section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'reconnect_interval', '2', section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_type', 'gre', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'tunnel_id_ranges', '1:1000', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'local_ip', local_ip, section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'integration_bridge', 'br-int', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'tunnel_bridge', 'br-tun', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'enable_tunneling', 'True', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo neutron-rootwrap ' '/etc/neutron/rootwrap.conf', section='AGENT') #utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', # 'neutron.agent.linux.iptables_firewall.' # 'OVSHybridIptablesFirewallDriver', # section='securitygroup') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') openvswitch_start() neutron_plugin_openvswitch_agent_start()
def configure_ovs_plugin_gre(controller_host=None, compute_ip=None, mysql_username='******', tunnel_start='1',tunnel_end='1000', mysql_password='******', mysql_port='3306', mysql_schema='quantum'): mysql_host=controller_host utils.set_option(OVS_PLUGIN_CONF,'sql_connection',utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username),section='DATABASE') utils.set_option(OVS_PLUGIN_CONF,'reconnect_interval','2',section='DATABASE') utils.set_option(OVS_PLUGIN_CONF,'tenant_network_type','gre',section='OVS') utils.set_option(OVS_PLUGIN_CONF,'tunnel_id_ranges','%s:%s' % (tunnel_start,tunnel_end),section='OVS') utils.set_option(OVS_PLUGIN_CONF,'local_ip', compute_ip, section='OVS') utils.set_option(OVS_PLUGIN_CONF,'integration_bridge','br-int',section='OVS') utils.set_option(OVS_PLUGIN_CONF,'tunnel_bridge','br-tun',section='OVS') utils.set_option(OVS_PLUGIN_CONF,'enable_tunneling','True',section='OVS') utils.set_option(OVS_PLUGIN_CONF,'root_helper','sudo /usr/bin/quantum-rootwrap /etc/quantum/rootwrap.conf',section='AGENT') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') quantum_plugin_openvswitch_agent_start()
def configure_ml2_plugin_vxlan(neutron_mysql_username='******', neutron_mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', neutron_mysql_schema='neutron'): # TODO Fix that when ml2-neutron-plugin will be added in icehouse sudo('mkdir -p /etc/neutron/plugins/ml2') sudo('ln -s %s %s' %(OVS_PLUGIN_CONF, ML2_PLUGIN_CONF)) sudo('echo "''" > %s' % OVS_PLUGIN_CONF) sudo('echo [ml2] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ovs] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ml2_type_vxlan] >> %s' % OVS_PLUGIN_CONF) sudo('echo [database] >> %s' % OVS_PLUGIN_CONF) sudo('echo [securitygroup] >> %s' % OVS_PLUGIN_CONF) sudo('echo [agent] >> %s' % OVS_PLUGIN_CONF) # ML2 section utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_types', 'vxlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'type_drivers', 'local,flat,vlan,gre,vxlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'mechanism_drivers', 'openvswitch,linuxbridge', section='ml2') # ml2_type_vxlan section utils.set_option(OVS_PLUGIN_CONF, 'vni_ranges', '1:1000', section='ml2_type_vxlan') # ovs section utils.set_option(OVS_PLUGIN_CONF, 'enable_tunneling', 'True', section='ovs') # database section utils.set_option(OVS_PLUGIN_CONF, 'connection', utils.sql_connect_string(mysql_host, neutron_mysql_password, mysql_port, neutron_mysql_schema, neutron_mysql_username), section='database') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') # agent section utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo neutron-rootwrap ' '/etc/neutron/rootwrap.conf', section='agent') utils.set_option(OVS_PLUGIN_CONF, 'tunnel_types', 'vxlan', section='agent')
def configure_ovs_plugin_vlan(vlan_start='1', vlan_end='4094', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='quantum'): utils.set_option(OVS_PLUGIN_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'reconnect_interval', '2', section='DATABASE') utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_type', 'vlan', section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'network_vlan_ranges', 'physnet1:%s:%s' % (vlan_start, vlan_end), section='OVS') utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo /usr/bin/quantum-rootwrap ' '/etc/quantum/rootwrap.conf', section='AGENT')
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_password='******', rabbit_host='127.0.0.1', mysql_username='******', mysql_password='******', mysql_schema='neutron', mysql_host='127.0.0.1', mysql_port='3306'): auth_uri = 'http://' + auth_host + ':5000/v2.0' sudo('echo OS_TENANT_NAME = service >> %s' % OPENRC) sudo('echo OS_USERNAME = %s >> %s' % (user, OPENRC)) sudo('echo OS_PASSWORD = %s >> %s' % (password, OPENRC)) sudo("""echo OS_AUTH_URL = "%s" >> %s""" % (auth_uri, OPENRC)) utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') #utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_uri', # auth_uri, section='filter:authtoken') utils.set_option(NEUTRON_CONF, 'fake_rabbit', 'False') utils.set_option(NEUTRON_CONF, 'rabbit_password', rabbit_password) utils.set_option(NEUTRON_CONF, 'rabbit_host', rabbit_host) utils.set_option(NEUTRON_CONF, 'notification_driver', 'neutron.openstack.common.notifier.rpc_notifier') utils.set_option(NEUTRON_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NEUTRON_CONF, 'default_notification_level', 'INFO') # Configurtin LBAAS service utils.set_option(NEUTRON_CONF, 'service_plugins', 'neutron.services.loadbalancer.plugin.LoadBalancerPlugin, ' 'neutron.services.firewall.fwaas_plugin.FirewallPlugin, ' 'neutron.services.l3_router.' 'l3_router_plugin.L3RouterPlugin') cp = 'neutron.plugins.ml2.plugin.Ml2Plugin' utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'connection', utils.sql_connect_string( mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='database') utils.set_option(NEUTRON_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_url', auth_uri, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'allow_overlapping_ips', 'True') utils.set_option(NEUTRON_CONF, 'quota_driver', 'neutron.db.quota_db.DbQuotaDriver', section='quotas')
def set_config_file(controller_host=None, public_ip=None, rabbit_password='******', mysql_username='******', mysql_password='******', mysql_port='3306', mysql_schema='nova', service_user='******', service_tenant_name='service', service_pass='******', auth_port='35357', auth_protocol='http', libvirt_type='kvm', vncproxy_port='6080', glance_port='9292'): if controller_host is None: puts("{error:'Controller IP of the node needed as argument'}") exit(0) quantum_url = 'http://%s:9696' % controller_host admin_auth_url = 'http://%s:35357/v2.0' % controller_host auth_host = controller_host mysql_host = controller_host vncproxy_host = public_ip glance_host = controller_host rabbit_host = controller_host utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_tenant_name', service_tenant_name, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_user', service_user, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_password', service_pass, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') utils.set_option(NOVA_COMPUTE_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username)) utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'use_deprecated_auth', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'logdir', '/var/log/nova') utils.set_option(NOVA_COMPUTE_CONF, 'state_path', '/var/lib/nova') utils.set_option(NOVA_COMPUTE_CONF, 'lock_path', '/var/lock/nova') utils.set_option(NOVA_COMPUTE_CONF, 'root_helper', 'sudo nova-rootwrap /etc/nova/rootwrap.conf') utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'notification_driver', 'nova.openstack.common.notifier.rabbit_notifier') utils.set_option(NOVA_COMPUTE_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NOVA_COMPUTE_CONF, 'default_notification_level', 'INFO') utils.set_option(NOVA_COMPUTE_CONF, 'connection_type', 'libvirt') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_type', libvirt_type) utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_ovs_bridge', 'br-int') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_vif_type', 'ethernet') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_vif_driver', 'nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_use_virtio_for_bridges', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'quantum_auth_strategy','keystone') utils.set_option(NOVA_COMPUTE_CONF, 'quantum_admin_username','quantum') utils.set_option(NOVA_COMPUTE_CONF, 'quantum_admin_password','stackops') utils.set_option(NOVA_COMPUTE_CONF, 'quantum_admin_tenant_name','service') utils.set_option(NOVA_COMPUTE_CONF, 'quantum_admin_auth_url',admin_auth_url) utils.set_option(NOVA_COMPUTE_CONF, 'quantum_url',quantum_url) utils.set_option(NOVA_COMPUTE_CONF, 'novncproxy_base_url', 'http://%s:%s/vnc_auto.html' % (vncproxy_host, vncproxy_port)) utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_listen', '0.0.0.0') utils.set_option(NOVA_COMPUTE_CONF, 'novnc_enable', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_proxyclient_address', "$my_ip") utils.set_option(NOVA_COMPUTE_CONF, 'compute_driver', 'libvirt.LibvirtDriver') utils.set_option(NOVA_COMPUTE_CONF, 'image_service', 'nova.image.glance.GlanceImageService') utils.set_option(NOVA_COMPUTE_CONF, 'glance_api_servers','%s:%s' % (glance_host, glance_port)) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password',rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'ec2_private_dns_show_ip', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'enabled_apis', 'ec2,osapi_compute,metadata') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.quantumv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'dmz_cidr', '169.254.169.254/32') utils.set_option(NOVA_COMPUTE_CONF, 'metadata_listen', '0.0.0.0') utils.set_option(NOVA_COMPUTE_CONF, 'volume_api_class', 'nova.volume.cinder.API') utils.set_option(NOVA_COMPUTE_CONF, 'cinder_catalog_info','volume:cinder:internalURL') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic','True') utils.set_option(NOVA_COMPUTE_CONF, 'allow_resize_to_same_host','True') start()
def set_config_file(mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema_designate ='designate', mysql_schema_powerdns ='powerdns', user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_host='localhost', rabbit_password='******'): utils.set_option(DESIGNATE_CONF, 'service:api', 'auth_strategy', 'keystone') utils.set_option(DESIGNATE_CONF, 'service:api', 'enabled_extensions_v1', 'diagnostics, quotas, reports, sync') utils.set_option(DESIGNATE_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' utils.set_option(DESIGNATE_CONF, 'auth_uri', auth_uri, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_strategy', 'keystone', section='[service:api]') utils.set_option(DESIGNATE_CONF, 'backend_driver', 'powerdns', section='service:central') utils.set_option(DESIGNATE_CONF, 'database_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema_designate, mysql_username), section='storage:sqlalchemy') utils.set_option(DESIGNATE_CONF, 'database_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema_powerdns, mysql_username), section='backend:powerdns') utils.set_option(DESIGNATE_CONF, 'rabbit_host', rabbit_host) utils.set_option(DESIGNATE_CONF, 'rabbit_password', rabbit_password) utils.set_option(DESIGNATE_CONF, 'notification_driver', 'designate.openstack.common.notifier.rpc_notifier') utils.set_option(DESIGNATE_CONF, 'notification_topics', 'notifications,monitor') with settings(warn_only = True): sudo('designate-manage database-init') sudo('designate-manage database-sync') with settings(warn_only = True): sudo('designate-manage powerdns database-init') sudo('designate-manage powerdns database-sync') #PowerDNS configuration utils.modify_property(POWERDNS_CONF, 'launch', 'gmysql') utils.modify_property(POWERDNS_CONF, 'gmysql-host', mysql_host) utils.modify_property(POWERDNS_CONF, 'gmysql-port', mysql_port) utils.modify_property(POWERDNS_CONF, 'gmysql-dbname', mysql_schema_powerdns) utils.modify_property(POWERDNS_CONF, 'gmysql-user', mysql_username) utils.modify_property(POWERDNS_CONF, 'gmysql-password', mysql_password) utils.modify_property(POWERDNS_CONF, 'gmysql-dnssec', 'yes')
def configure_ml2_plugin_vlan(br_postfix='bond-vm', vlan_start='2', vlan_end='4094', neutron_mysql_username='******', neutron_mysql_password='******', neutron_mysql_host='127.0.0.1', neutron_mysql_port='3306', neutron_mysql_schema='neutron'): # TODO Fix that when ml2-neutron-plugin will be added in icehouse sudo('mkdir -p /etc/neutron/plugins/ml2') sudo('ln -s %s %s' % (OVS_PLUGIN_CONF, ML2_PLUGIN_CONF)) sudo('echo "' '" > %s' % OVS_PLUGIN_CONF) sudo('echo [ml2] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ovs] >> %s' % OVS_PLUGIN_CONF) sudo('echo [ml2_type_vlan] >> %s' % OVS_PLUGIN_CONF) sudo('echo [database] >> %s' % OVS_PLUGIN_CONF) sudo('echo [securitygroup] >> %s' % OVS_PLUGIN_CONF) sudo('echo [agent] >> %s' % OVS_PLUGIN_CONF) # ML2 section utils.set_option(OVS_PLUGIN_CONF, 'tenant_network_types', 'vlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'type_drivers', 'local,flat,vlan,gre,vxlan', section='ml2') utils.set_option(OVS_PLUGIN_CONF, 'mechanism_drivers', 'openvswitch,linuxbridge', section='ml2') # ml2_type_vlan section utils.set_option(OVS_PLUGIN_CONF, 'network_vlan_ranges', 'physnet1:%s:%s' % (vlan_start, vlan_end), section='ml2_type_vlan') utils.set_option(OVS_PLUGIN_CONF, 'bridge_mappings', 'physnet1:br-%s' % br_postfix, section='ovs') # database section utils.set_option(OVS_PLUGIN_CONF, 'connection', utils.sql_connect_string(neutron_mysql_host, neutron_mysql_password, neutron_mysql_port, neutron_mysql_schema, neutron_mysql_username), section='database') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') # agent section utils.set_option(OVS_PLUGIN_CONF, 'root_helper', 'sudo neutron-rootwrap ' '/etc/neutron/rootwrap.conf', section='agent') with settings(warn_only=True): sudo('ovs-vsctl del-br br-int') sudo('ovs-vsctl add-br br-int') neutron_plugin_openvswitch_agent_start()
def configure_neutron(neutron_service_user='******', neutron_service_password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', neutron_service_tenant='service', rabbit_password='******', rabbit_host='127.0.0.1', neutron_mysql_username='******', neutron_mysql_password='******', neutron_mysql_schema='neutron', mysql_host='127.0.0.1', mysql_port='3306'): cp = 'neutron.plugins.ml2.plugin.Ml2Plugin' utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'auth_strategy', 'keystone') utils.set_option(NEUTRON_CONF, 'fake_rabbit', 'False') utils.set_option(NEUTRON_CONF, 'rabbit_password', rabbit_password) utils.set_option(NEUTRON_CONF, 'rabbit_host', rabbit_host) utils.set_option(NEUTRON_CONF, 'notification_driver', 'nova.openstack.common.notifier.rpc_notifier') utils.set_option(NEUTRON_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NEUTRON_CONF, 'default_notification_level', 'INFO') utils.set_option(NEUTRON_CONF, 'connection', utils.sql_connect_string(mysql_host, neutron_mysql_password, mysql_port, neutron_mysql_schema, neutron_mysql_username), section='database') utils.set_option(NEUTRON_CONF, 'admin_tenant_name', neutron_service_tenant, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_user', neutron_service_user, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_password', neutron_service_password, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' utils.set_option(NEUTRON_CONF, 'auth_url', auth_uri, section='keystone_authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_tenant_name', neutron_service_tenant, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_user', neutron_service_user, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_password', neutron_service_password, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') neutron_plugin_openvswitch_agent_start()
def set_config_file(management_ip=None, controller_host=None, vncproxy_host=None, auth_host=None, nova_mysql_host=None, glance_host=None, rabbit_host=None, rabbit_password='******', nova_mysql_username='******', nova_mysql_password='******', nova_mysql_port='3306', nova_mysql_schema='nova', nova_service_user='******', nova_service_tenant='service', nova_service_pass='******', auth_port='35357', auth_protocol='http', libvirt_type='kvm', vncproxy_protocol="https", vncproxy_port='6080', glance_port='9292'): if controller_host is None: puts("{error:'Management IP of the node needed as argument'}") exit(0) neutron_url = 'http://%s:9696' % controller_host admin_auth_url = 'http://%s:35357/v2.0' % auth_host vncproxy_url = '%s://%s:%s/vnc_auto.html' % (vncproxy_protocol, vncproxy_host, vncproxy_port) auth_host = auth_host mysql_host = nova_mysql_host glance_host = glance_host rabbit_host = rabbit_host utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_tenant_name', nova_service_tenant, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_user', nova_service_user, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_password', nova_service_pass, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') utils.set_option( NOVA_COMPUTE_CONF, 'sql_connection', utils.sql_connect_string(nova_mysql_host, nova_mysql_password, nova_mysql_port, nova_mysql_schema, nova_mysql_username)) utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'use_deprecated_auth', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'logdir', '/var/log/nova') utils.set_option(NOVA_COMPUTE_CONF, 'state_path', '/var/lib/nova') utils.set_option(NOVA_COMPUTE_CONF, 'lock_path', '/var/lock/nova') utils.set_option(NOVA_COMPUTE_CONF, 'root_helper', 'sudo nova-rootwrap /etc/nova/rootwrap.conf') utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'rpc_backend', 'nova.rpc.impl_kombu') utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password', rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'notification_driver', 'nova.openstack.common.notifier.rpc_notifier') utils.set_option(NOVA_COMPUTE_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NOVA_COMPUTE_CONF, 'default_notification_level', 'INFO') utils.set_option(NOVA_COMPUTE_CONF, 'my_ip', management_ip) utils.set_option(NOVA_COMPUTE_CONF, 'connection_type', 'libvirt') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_type', libvirt_type) utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_ovs_bridge', 'br-int') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_vif_type', 'ethernet') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_vif_driver', 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_use_virtio_for_bridges', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_username', 'neutron') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_password', 'stackops') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_tenant_name', 'service') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_auth_url', admin_auth_url) utils.set_option(NOVA_COMPUTE_CONF, 'neutron_url', neutron_url) utils.set_option(NOVA_COMPUTE_CONF, 'novncproxy_base_url', vncproxy_url) utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_listen', '0.0.0.0') utils.set_option(NOVA_COMPUTE_CONF, 'vnc_enabled', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_proxyclient_address', management_ip) utils.set_option(NOVA_COMPUTE_CONF, 'compute_driver', 'libvirt.LibvirtDriver') utils.set_option(NOVA_COMPUTE_CONF, 'image_service', 'nova.image.glance.GlanceImageService') utils.set_option(NOVA_COMPUTE_CONF, 'glance_api_servers', '%s:%s' % (glance_host, glance_port)) utils.set_option(NOVA_COMPUTE_CONF, 'glance_host', glance_host) # Change for havana to use the neutron fw and security group utils.set_option(NOVA_COMPUTE_CONF, 'firewall_driver', 'nova.virt.firewall.NoopFirewallDriver') utils.set_option(NOVA_COMPUTE_CONF, 'security_group_api', 'neutron') utils.set_option(NOVA_COMPUTE_CONF, 'ec2_private_dns_show_ip', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.neutronv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'dmz_cidr', '169.254.169.254/32') utils.set_option(NOVA_COMPUTE_CONF, 'volume_api_class', 'nova.volume.cinder.API') utils.set_option(NOVA_COMPUTE_CONF, 'cinder_catalog_info', 'volume:cinder:internalURL') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'allow_resize_to_same_host', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'resize_confirm_window', '3600') utils.set_option(NOVA_COMPUTE_CONF, 'snapshot_compression', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'snapshot_image_format', 'qcow2') utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'true') start()
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', neutron_host='127.0.0.1', rabbit_host='127.0.0.1', vncproxy_host='127.0.0.1', glance_host='127.0.0.1', glance_port='9292', mysql_username='******', mysql_password='******', mysql_schema='nova', mysql_host='127.0.0.1', tenant='service', mysql_port='3306', rabbit_password='******', vncproxy_port='6080', vcenter_host_ip='localhost', vecenter_host_username='******', vcenter_host_password='******', vcenter_cluster_name='my_cluster', integration_bridge='br-int'): utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') utils.set_option( NOVA_COMPUTE_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username)) utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'allow_resize_to_same_host', 'True') utils.set_option(NOVA_CONF, 'compute_driver', 'vmwareapi.VMwareVCDriver') # Vmware section utils.set_option(NOVA_CONF, 'host_ip', vcenter_host_ip, section='vmware') utils.set_option(NOVA_CONF, 'host_username', vecenter_host_username, section='vmware') utils.set_option(NOVA_CONF, 'host_passwod', vcenter_host_password, section='vmware') utils.set_option(NOVA_CONF, 'cluster_name', vcenter_cluster_name, section='vmware') utils.set_option(NOVA_CONF, 'integration_bridge', integration_bridge, section='vmware') wsdl_loc = 'http://%s/sdk/vimService.wsdl' % vcenter_host_ip utils.set_option(NOVA_CONF, 'wsdl_location', wsdl_loc, section='vmware') #utils.set_option(NOVA_CONF, 'datastore_regex', # datastore_regex, section='vmware') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.neutronv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_username', 'neutron') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_password', 'stackops') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_tenant_name', 'service') admin_auth_url = 'http://' + auth_host + ':35357/v2.0' utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_auth_url', admin_auth_url) neutron_url = 'http://' + neutron_host + ':9696' utils.set_option(NOVA_COMPUTE_CONF, 'neutron_url', neutron_url) utils.set_option(NOVA_COMPUTE_CONF, 'rpc_backend', 'nova.rpc.impl_kombu') utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password', rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'use_deprecated_auth', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'logdir', '/var/log/nova') utils.set_option(NOVA_COMPUTE_CONF, 'state_path', '/var/lib/nova') utils.set_option(NOVA_COMPUTE_CONF, 'lock_path', '/var/lock/nova') utils.set_option(NOVA_COMPUTE_CONF, 'root_helper', 'sudo nova-rootwrap /etc/nova/rootwrap.conf') utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'notification_driver', 'nova.openstack.common.notifier.rpc_notifier') utils.set_option(NOVA_COMPUTE_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NOVA_COMPUTE_CONF, 'default_notification_level', 'INFO') utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'false') utils.set_option( NOVA_COMPUTE_CONF, 'novncproxy_base_url', 'http://%s:%s/vnc_auto.html' % (vncproxy_host, vncproxy_port)) utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_listen', '0.0.0.0') utils.set_option(NOVA_COMPUTE_CONF, 'vnc_enable', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'compute_driver', 'libvirt.LibvirtDriver') utils.set_option(NOVA_COMPUTE_CONF, 'image_service', 'nova.image.glance.GlanceImageService') utils.set_option(NOVA_COMPUTE_CONF, 'glance_api_servers', '%s:%s' % (glance_host, glance_port)) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password', rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'ec2_private_dns_show_ip', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.neutronv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'dmz_cidr', '169.254.169.254/32') utils.set_option(NOVA_COMPUTE_CONF, 'volume_api_class', 'nova.volume.cinder.API') utils.set_option(NOVA_COMPUTE_CONF, 'cinder_catalog_info', 'volume:cinder:internalURL') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic', 'True') start()
def set_config_file(management_ip=None, controller_host=None, vncproxy_host=None, auth_host=None, nova_mysql_host=None, glance_host=None, rabbit_host=None, rabbit_password='******', nova_mysql_username='******', nova_mysql_password='******', nova_mysql_port='3306', nova_mysql_schema='nova', nova_service_user='******', nova_service_tenant='service', nova_service_pass='******', auth_port='35357', auth_protocol='http', libvirt_type='kvm', vncproxy_protocol="https", vncproxy_port='6080', glance_port='9292'): if controller_host is None: puts("{error:'Management IP of the node needed as argument'}") exit(0) neutron_url = 'http://%s:9696' % controller_host admin_auth_url = 'http://%s:35357/v2.0' % auth_host vncproxy_url = '%s://%s:%s/vnc_auto.html' % (vncproxy_protocol, vncproxy_host, vncproxy_port) auth_host = auth_host mysql_host = nova_mysql_host glance_host = glance_host rabbit_host = rabbit_host utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_tenant_name', nova_service_tenant, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_user', nova_service_user, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_password', nova_service_pass, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') utils.set_option(NOVA_COMPUTE_CONF, 'sql_connection', utils.sql_connect_string(nova_mysql_host, nova_mysql_password, nova_mysql_port, nova_mysql_schema, nova_mysql_username)) utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'use_deprecated_auth', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'logdir', '/var/log/nova') utils.set_option(NOVA_COMPUTE_CONF, 'state_path', '/var/lib/nova') utils.set_option(NOVA_COMPUTE_CONF, 'lock_path', '/var/lock/nova') utils.set_option(NOVA_COMPUTE_CONF, 'root_helper', 'sudo nova-rootwrap /etc/nova/rootwrap.conf') utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'rpc_backend', 'nova.rpc.impl_kombu') utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password', rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'notification_driver', 'nova.openstack.common.notifier.rpc_notifier') utils.set_option(NOVA_COMPUTE_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NOVA_COMPUTE_CONF, 'default_notification_level', 'INFO') utils.set_option(NOVA_COMPUTE_CONF, 'my_ip', management_ip) utils.set_option(NOVA_COMPUTE_CONF, 'connection_type', 'libvirt') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_type', libvirt_type) utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_ovs_bridge', 'br-int') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_vif_type', 'ethernet') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_vif_driver', 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver') utils.set_option(NOVA_COMPUTE_CONF, 'libvirt_use_virtio_for_bridges', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_username', 'neutron') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_password', 'stackops') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_tenant_name', 'service') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_auth_url', admin_auth_url) utils.set_option(NOVA_COMPUTE_CONF, 'neutron_url', neutron_url) utils.set_option(NOVA_COMPUTE_CONF, 'novncproxy_base_url', vncproxy_url) utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_listen', '0.0.0.0') utils.set_option(NOVA_COMPUTE_CONF, 'vnc_enabled', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_proxyclient_address', management_ip) utils.set_option(NOVA_COMPUTE_CONF, 'compute_driver', 'libvirt.LibvirtDriver') utils.set_option(NOVA_COMPUTE_CONF, 'image_service', 'nova.image.glance.GlanceImageService') utils.set_option(NOVA_COMPUTE_CONF, 'glance_api_servers', '%s:%s' % (glance_host, glance_port)) utils.set_option(NOVA_COMPUTE_CONF, 'glance_host', glance_host) # Change for havana to use the neutron fw and security group utils.set_option(NOVA_COMPUTE_CONF, 'firewall_driver', 'nova.virt.firewall.NoopFirewallDriver') utils.set_option(NOVA_COMPUTE_CONF, 'security_group_api', 'neutron') utils.set_option(NOVA_COMPUTE_CONF, 'ec2_private_dns_show_ip', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.neutronv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'dmz_cidr', '169.254.169.254/32') utils.set_option(NOVA_COMPUTE_CONF, 'volume_api_class', 'nova.volume.cinder.API') utils.set_option(NOVA_COMPUTE_CONF, 'cinder_catalog_info', 'volume:cinder:internalURL') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'allow_resize_to_same_host', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'resize_confirm_window', '3600') utils.set_option(NOVA_COMPUTE_CONF, 'snapshot_compression', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'snapshot_image_format', 'qcow2') utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'true') start()
def set_config_file(mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema_designate='designate', mysql_schema_powerdns='powerdns', user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_host='localhost', rabbit_password='******'): utils.set_option(DESIGNATE_CONF, 'service:api', 'auth_strategy', 'keystone') utils.set_option(DESIGNATE_CONF, 'service:api', 'enabled_extensions_v1', 'diagnostics, quotas, reports, sync') utils.set_option(DESIGNATE_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' utils.set_option(DESIGNATE_CONF, 'auth_uri', auth_uri, section='keystone_authtoken') utils.set_option(DESIGNATE_CONF, 'auth_strategy', 'keystone', section='[service:api]') utils.set_option(DESIGNATE_CONF, 'backend_driver', 'powerdns', section='service:central') utils.set_option(DESIGNATE_CONF, 'database_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema_designate, mysql_username), section='storage:sqlalchemy') utils.set_option(DESIGNATE_CONF, 'database_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema_powerdns, mysql_username), section='backend:powerdns') utils.set_option(DESIGNATE_CONF, 'rabbit_host', rabbit_host) utils.set_option(DESIGNATE_CONF, 'rabbit_password', rabbit_password) utils.set_option(DESIGNATE_CONF, 'notification_driver', 'designate.openstack.common.notifier.rpc_notifier') utils.set_option(DESIGNATE_CONF, 'notification_topics', 'notifications,monitor') with settings(warn_only=True): sudo('designate-manage database-init') sudo('designate-manage database-sync') with settings(warn_only=True): sudo('designate-manage powerdns database-init') sudo('designate-manage powerdns database-sync') #PowerDNS configuration utils.modify_property(POWERDNS_CONF, 'launch', 'gmysql') utils.modify_property(POWERDNS_CONF, 'gmysql-host', mysql_host) utils.modify_property(POWERDNS_CONF, 'gmysql-port', mysql_port) utils.modify_property(POWERDNS_CONF, 'gmysql-dbname', mysql_schema_powerdns) utils.modify_property(POWERDNS_CONF, 'gmysql-user', mysql_username) utils.modify_property(POWERDNS_CONF, 'gmysql-password', mysql_password) utils.modify_property(POWERDNS_CONF, 'gmysql-dnssec', 'yes')
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', neutron_host='127.0.0.1', rabbit_host='127.0.0.1', vncproxy_host='127.0.0.1', glance_host='127.0.0.1', glance_port='9292', mysql_username='******', mysql_password='******', mysql_schema='nova', mysql_host='127.0.0.1', tenant='service', mysql_port='3306', rabbit_password='******', vncproxy_port='6080', vcenter_host_ip='localhost', vecenter_host_username='******', vcenter_host_password='******', vcenter_cluster_name='my_cluster', integration_bridge='br-int'): utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(COMPUTE_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') utils.set_option(NOVA_COMPUTE_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username)) utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'allow_resize_to_same_host', 'True') utils.set_option(NOVA_CONF, 'compute_driver', 'vmwareapi.VMwareVCDriver') # Vmware section utils.set_option(NOVA_CONF, 'host_ip', vcenter_host_ip, section='vmware') utils.set_option(NOVA_CONF, 'host_username', vecenter_host_username, section='vmware') utils.set_option(NOVA_CONF, 'host_passwod', vcenter_host_password, section='vmware') utils.set_option(NOVA_CONF, 'cluster_name', vcenter_cluster_name, section='vmware') utils.set_option(NOVA_CONF, 'integration_bridge', integration_bridge, section='vmware') wsdl_loc = 'http://%s/sdk/vimService.wsdl' % vcenter_host_ip utils.set_option(NOVA_CONF, 'wsdl_location', wsdl_loc, section='vmware') #utils.set_option(NOVA_CONF, 'datastore_regex', # datastore_regex, section='vmware') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.neutronv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_username', 'neutron') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_password', 'stackops') utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_tenant_name', 'service') admin_auth_url = 'http://' + auth_host + ':35357/v2.0' utils.set_option(NOVA_COMPUTE_CONF, 'neutron_admin_auth_url', admin_auth_url) neutron_url = 'http://' + neutron_host + ':9696' utils.set_option(NOVA_COMPUTE_CONF, 'neutron_url', neutron_url) utils.set_option(NOVA_COMPUTE_CONF, 'rpc_backend', 'nova.rpc.impl_kombu') utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password', rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'auth_strategy', 'keystone') utils.set_option(NOVA_COMPUTE_CONF, 'use_deprecated_auth', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'logdir', '/var/log/nova') utils.set_option(NOVA_COMPUTE_CONF, 'state_path', '/var/lib/nova') utils.set_option(NOVA_COMPUTE_CONF, 'lock_path', '/var/lock/nova') utils.set_option(NOVA_COMPUTE_CONF, 'root_helper', 'sudo nova-rootwrap /etc/nova/rootwrap.conf') utils.set_option(NOVA_COMPUTE_CONF, 'verbose', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'notification_driver', 'nova.openstack.common.notifier.rpc_notifier') utils.set_option(NOVA_COMPUTE_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NOVA_COMPUTE_CONF, 'default_notification_level', 'INFO') utils.set_option(NOVA_COMPUTE_CONF, 'start_guests_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'resume_guests_state_on_host_boot', 'false') utils.set_option(NOVA_COMPUTE_CONF, 'novncproxy_base_url', 'http://%s:%s/vnc_auto.html' % (vncproxy_host, vncproxy_port)) utils.set_option(NOVA_COMPUTE_CONF, 'vncserver_listen', '0.0.0.0') utils.set_option(NOVA_COMPUTE_CONF, 'vnc_enable', 'true') utils.set_option(NOVA_COMPUTE_CONF, 'compute_driver', 'libvirt.LibvirtDriver') utils.set_option(NOVA_COMPUTE_CONF, 'image_service', 'nova.image.glance.GlanceImageService') utils.set_option(NOVA_COMPUTE_CONF, 'glance_api_servers', '%s:%s' % (glance_host, glance_port)) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_host', rabbit_host) utils.set_option(NOVA_COMPUTE_CONF, 'rabbit_password', rabbit_password) utils.set_option(NOVA_COMPUTE_CONF, 'ec2_private_dns_show_ip', 'True') utils.set_option(NOVA_COMPUTE_CONF, 'network_api_class', 'nova.network.neutronv2.api.API') utils.set_option(NOVA_COMPUTE_CONF, 'dmz_cidr', '169.254.169.254/32') utils.set_option(NOVA_COMPUTE_CONF, 'volume_api_class', 'nova.volume.cinder.API') utils.set_option(NOVA_COMPUTE_CONF, 'cinder_catalog_info', 'volume:cinder:internalURL') utils.set_option(NOVA_COMPUTE_CONF, 'allow_same_net_traffic', 'True') start()
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', mysql_username='******', mysql_password='******', mysql_host='127.0.0.1', mysql_port='3306', mysql_schema='cinder', tenant='service', rabbit_password='******', rabbit_host='localhost', iscsi_ip_address='127.0.0.1'): utils.set_option(CINDER_CONF, 'rootwrap_config', '/etc/cinder/rootwrap.conf') utils.set_option(CINDER_CONF, 'auth_strategy', 'keystone') utils.set_option(CINDER_CONF, 'iscsi_helper', 'tgtadm') utils.set_option(CINDER_CONF, 'rpc_backend', 'cinder.openstack.common.rpc.impl_kombu') utils.set_option(CINDER_CONF, 'rabbit_password', rabbit_password) utils.set_option(CINDER_CONF, 'rabbit_host', rabbit_host) utils.set_option( CINDER_CONF, 'sql_connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username)) utils.set_option(CINDER_CONF, 'verbose', 'true') utils.set_option(CINDER_CONF, 'api_paste_config', '/etc/cinder/api-paste.ini') utils.set_option(CINDER_CONF, 'volume_group', 'cinder-volumes') utils.set_option(CINDER_CONF, 'iscsi_ip_address', iscsi_ip_address) utils.set_option(CINDER_CONF, 'log_dir', '/var/log/cinder') utils.set_option(CINDER_CONF, 'notification_driver', 'cinder.openstack.common.notifier.rpc_notifier') utils.set_option(CINDER_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(CINDER_CONF, 'default_notification_level', 'INFO') # Check storage types, TODO: Add more storages types ''' utils.set_option(CINDER_CONF, 'scheduler_driver', 'cinder.scheduler.filter_scheduler.FilterScheduler') utils.set_option(CINDER_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(CINDER_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') auth_uri = 'http://' + auth_host + ':5000/v2.0' utils.set_option(CINDER_API_PASTE_CONF, 'auth_uri', auth_uri, section='filter:authtoken')
def set_config_file(user='******', password='******', auth_host='127.0.0.1', auth_port='35357', auth_protocol='http', tenant='service', rabbit_password='******', rabbit_host='127.0.0.1', mysql_username='******', mysql_password='******', mysql_schema='neutron', mysql_host='127.0.0.1', mysql_port='3306'): utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_tenant_name', tenant, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_user', user, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'admin_password', password, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_host', auth_host, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_port', auth_port, section='filter:authtoken') utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_protocol', auth_protocol, section='filter:authtoken') auth_uri = 'http://' + auth_host + ':5000' utils.set_option(NEUTRON_API_PASTE_CONF, 'auth_uri', auth_uri, section='filter:authtoken') cp = 'neutron.plugins.ml2.plugin.Ml2Plugin' utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'auth_strategy', 'keystone') utils.set_option(NEUTRON_CONF, 'fake_rabbit', 'False') utils.set_option(NEUTRON_CONF, 'rabbit_password', rabbit_password) utils.set_option(NEUTRON_CONF, 'rabbit_host', rabbit_host) utils.set_option(NEUTRON_CONF, 'notification_driver', 'neutron.openstack.common.notifier.rpc_notifier') utils.set_option(NEUTRON_CONF, 'notification_topics', 'notifications,monitor') utils.set_option(NEUTRON_CONF, 'default_notification_level', 'INFO') utils.set_option(NEUTRON_CONF, 'core_plugin', cp) utils.set_option(NEUTRON_CONF, 'connection', utils.sql_connect_string(mysql_host, mysql_password, mysql_port, mysql_schema, mysql_username), section='database') utils.set_option(NEUTRON_CONF, 'admin_tenant_name', tenant, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_user', user, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'admin_password', password, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_host', auth_host, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_port', auth_port, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'auth_protocol', auth_protocol, section='keystone_authtoken') utils.set_option(NEUTRON_CONF, 'allow_overlapping_ips', 'True') # security group section utils.set_option(OVS_PLUGIN_CONF, 'firewall_driver', 'neutron.agent.linux.iptables_firewall.' 'OVSHybridIptablesFirewallDriver', section='securitygroup') utils.set_option(NEUTRON_CONF, 'quota_driver', 'neutron.db.quota_db.DbQuotaDriver', section='quotas')