Commit 713d0d08 authored by Leonard Marschke's avatar Leonard Marschke

saving some work

parent 36fa0201
[ceph]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_pool = volumes
rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot = false
rbd_max_clone_depth = 5
rbd_store_chunk_size = 4
rados_connect_timeout = -1
glance_api_version = 2
\ No newline at end of file
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = cinder
password = lmm123
CREATE DATABASE cinder;
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'lmm123';
GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'lmm123';
...@@ -190,7 +190,6 @@ def installNovaController(): ...@@ -190,7 +190,6 @@ def installNovaController():
sudo("cat /tmp/novaConfigBlockKeystone >> /etc/nova/nova.conf") sudo("cat /tmp/novaConfigBlockKeystone >> /etc/nova/nova.conf")
sudo("cat /tmp/novaConfigBlockVNCController >> /etc/nova/nova.conf") sudo("cat /tmp/novaConfigBlockVNCController >> /etc/nova/nova.conf")
# sudo("sed -i -e 's|^#auth_strategy.*$|auth_strategy = keystone|' /etc/nova/nova.conf") # sudo("sed -i -e 's|^#auth_strategy.*$|auth_strategy = keystone|' /etc/nova/nova.conf")
sudo("sed -i -e 's|^my_ip.*$|my_ip = 192.168.3.10|' /etc/nova/nova.conf")
# sudo("sed -i -e 's|^#my_ip.*$|my_ip = 192.168.3.10|' /etc/nova/nova.conf") # sudo("sed -i -e 's|^#my_ip.*$|my_ip = 192.168.3.10|' /etc/nova/nova.conf")
# sudo("sed -i -e 's|^#firewall_driver.*$|firewall_driver = nova.virt.firewall.NoopFirewallDriver|' /etc/nova/nova.conf") # sudo("sed -i -e 's|^#firewall_driver.*$|firewall_driver = nova.virt.firewall.NoopFirewallDriver|' /etc/nova/nova.conf")
...@@ -351,6 +350,122 @@ def verifyNeutron(): ...@@ -351,6 +350,122 @@ def verifyNeutron():
run("neutron ext-list") run("neutron ext-list")
run("openstack network agent list") run("openstack network agent list")
@roles('node')
def cephPreflight():
sudo("useradd -d /home/ceph -m ceph")
sudo("echo \"ceph ALL = (root) NOPASSWD:ALL\" | tee /etc/sudoers.d/ceph")
sudo("chmod 0440 /etc/sudoers.d/ceph")
with cd("/home/ceph"):
sudo("mkdir .ssh", user="ceph")
sudo("chmod 700 .ssh", user="ceph")
put('~/.ssh/id_rsa.pub', '.ssh/authorized_keys', use_sudo=True)
sudo("chown ceph:ceph .ssh/authorized_keys")
sudo("chmod 600 .ssh/authorized_keys", user="ceph")
cephHostNames = ["node1", "node2", "node3"]
def cephDeployInstall():
local("ceph-deploy --username ceph uninstall " + " ".join(cephHostNames))
local("ceph-deploy --username ceph purge " + " ".join(cephHostNames))
local("ceph-deploy --username ceph install " + " ".join(cephHostNames))
local("ceph-deploy --username ceph new " + " ".join(cephHostNames))
local("ceph-deploy --username ceph mon create " + " ".join(cephHostNames))
local("ceph-deploy --username ceph gatherkeys " + cephHostNames[0])
def cephInitOSD():
#for node in cephHostNames:
# local("ceph-deploy disk zap ceph@" + node + ":sdb")
for node in cephHostNames:
local("ceph-deploy osd prepare ceph@" + node + ":sdb")
for node in cephHostNames:
local("ceph-deploy osd activate ceph@" + node + ":sdb")
def cephMDS():
local("ceph-deploy --username ceph mds create " + " ".join(cephHostNames))
@roles('node')
def noCephAuth():
sudo("sed -i -e 's|^auth_cluster_required.*$|auth_cluster_required = none|' /etc/ceph/ceph.conf")
sudo("sed -i -e 's|^auth_service_required.*$|auth_service_required = none|' /etc/ceph/ceph.conf")
sudo("sed -i -e 's|^auth_client_required.*$|auth_client_required = none|' /etc/ceph/ceph.conf")
@roles('controller')
def installCinderController():
put("cinderSetup.sql", "/tmp/cinderSetup.sql")
sudo("cat /tmp/cinderSetup.sql | mysql -u root -plmm123")
with shell_env(**identityServiceEnvsAdmin):
run("openstack user create --domain default --password lmm123 cinder")
run("openstack role add --project service --user cinder admin")
run("openstack service create --name cinder --description \"OpenStack Block Storage\" volume")
run("openstack service create --name cinderv2 --description \"OpenStack Block Storage\" volumev2")
run("openstack endpoint create --region RegionOne volume public http://controller:8776/v1/%\(tenant_id\)s")
run("openstack endpoint create --region RegionOne volume internal http://controller:8776/v1/%\(tenant_id\)s")
run("openstack endpoint create --region RegionOne volume admin http://controller:8776/v1/%\(tenant_id\)s")
run("openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%\(tenant_id\)s")
run("openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%\(tenant_id\)s")
run("openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%\(tenant_id\)s")
sudo("apt-get install -y cinder-api cinder-scheduler")
sudo("echo 'transport_url = rabbit://openstack:lmm123@controller' >> /etc/cinder/cinder.conf")
sudo("echo 'my_ip = 192.168.3.10' >> /etc/cinder/cinder.conf")
sudo("sed -i -e 's|^auth_strategy.*$|auth_strategy = keystone|' /etc/cinder/cinder.conf")
sudo("echo '[database]' >> /etc/cinder/cinder.conf")
sudo("echo 'connection = mysql+pymysql://cinder:lmm123@controller/cinder' >> /etc/cinder/cinder.conf")
put("cinderConfigBlockKeystone", "/tmp/cinderConfigBlockKeystone")
sudo("cat /tmp/cinderConfigBlockKeystone >> /etc/cinder/cinder.conf")
sudo("cinder-manage db sync", user="cinder")
sudo("echo '[cinder]' >> /etc/nova/nova.conf")
sudo("echo 'os_region_name = RegionOne' >> /etc/nova/nova.conf")
sudo("systemctl restart cinder-scheduler")
sudo("systemctl restart cinder-api")
@roles('node')
def installCinderNode():
sudo("apt-get remove -y --purge cinder-volume cinder-common")
sudo("apt-get install -y cinder-volume")
sudo("echo 'transport_url = rabbit://openstack:lmm123@controller' >> /etc/cinder/cinder.conf")
sudo("echo 'enabled_backends = ceph' >> /etc/cinder/cinder.conf")
sudo("echo 'my_ip = " + env.host + "' >> /etc/cinder/cinder.conf")
sudo("sed -i -e 's|^auth_strategy.*$|auth_strategy = keystone|' /etc/cinder/cinder.conf")
sudo("echo '[database]' >> /etc/cinder/cinder.conf")
sudo("echo 'connection = mysql+pymysql://cinder:lmm123@controller/cinder' >> /etc/cinder/cinder.conf")
put("cinderConfigBlockKeystone", "/tmp/cinderConfigBlockKeystone")
sudo("cat /tmp/cinderConfigBlockKeystone >> /etc/cinder/cinder.conf")
put("cinderConfigBlockCeph", "/tmp/cinderConfigBlockCeph")
sudo("cat /tmp/cinderConfigBlockCeph >> /etc/cinder/cinder.conf")
sudo("systemctl restart cinder-volume")
@roles('controller')
def cinderVerify():
with shell_env(**identityServiceEnvsAdmin):
run("openstack volume service list")
@roles('controller')
def extNet():
with shell_env(**identityServiceEnvsAdmin):
run("neutron net-create --provider:network_type=flat --router:external=true --provider:physical-network=br0_1 --shared ext_network_router")
run("neutron subnet-create --enable-dhcp=False --name ext_subnet_router --allocation-pool start=192.168.3.100,end=192.168.3.200 ext_network_router 192.168.3.0/24")
@roles('controller', 'node') @roles('controller', 'node')
def test(): def test():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment