Archived
Create Заметка 005. Миграция контроллера
@@ -0,0 +1,847 @@
|
||||
# Что сейчас запущено на контроллере:
|
||||
1. Keystone
|
||||
2. Nova
|
||||
3. Placement
|
||||
3. Horizon
|
||||
|
||||
# Общее:
|
||||
## Сеть
|
||||
```
|
||||
echo 'TYPE=Ethernet
|
||||
BOOTPROTO=none
|
||||
NAME=eth0
|
||||
DEVICE=eth0
|
||||
ONBOOT=yes
|
||||
IPADDR=172.17.1.100
|
||||
PREFIX=24
|
||||
GATEWAY=172.17.1.1
|
||||
DNS1=172.17.1.10
|
||||
DOMAIN=resds.ru
|
||||
ZONE=public' > /etc/sysconfig/network-scripts/ifcfg-eth0
|
||||
|
||||
echo 'TYPE=Ethernet
|
||||
BOOTPROTO=none
|
||||
DEFROUTE=yes
|
||||
NAME=eth1
|
||||
DEVICE=eth1
|
||||
ONBOOT=yes
|
||||
IPADDR=172.17.2.100
|
||||
PREFIX=24
|
||||
DNS1=172.17.1.10
|
||||
DOMAIN=resds.ru
|
||||
ZONE=public' > /etc/sysconfig/network-scripts/ifcfg-eth1
|
||||
```
|
||||
|
||||
## /etc/hosts
|
||||
```
|
||||
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
|
||||
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
|
||||
|
||||
172.17.1.34 videonova
|
||||
172.17.1.36 videocisco
|
||||
172.17.1.54 bonchvisor04
|
||||
172.17.1.55 bonchvisor05
|
||||
172.17.1.56 bonchvisor06
|
||||
172.17.1.57 bonchvisor07
|
||||
172.17.1.58 bonchvisor08
|
||||
172.17.1.59 bonchvisor09
|
||||
172.17.1.60 bonchvisor10
|
||||
172.17.1.61 bonchvisor11
|
||||
172.17.1.62 bonchvisor12
|
||||
172.17.1.63 bonchvisor13
|
||||
172.17.1.64 bonchvisor14
|
||||
172.17.1.65 bonchvisor15
|
||||
172.17.1.66 bonchvisor16
|
||||
172.17.1.67 bonchvisor17
|
||||
172.17.1.68 bonchvisor18
|
||||
172.17.1.50 controller-ceph
|
||||
172.17.1.100 controller-virt
|
||||
172.17.1.200 controller-net' > /etc/hosts
|
||||
```
|
||||
## Chrony
|
||||
```
|
||||
yum install chrony
|
||||
|
||||
echo 'server 172.16.4.11 iburst
|
||||
server 172.16.4.95 iburst
|
||||
driftfile /var/lib/chrony/drift
|
||||
makestep 1.0 3
|
||||
rtcsync
|
||||
logdir /var/log/chrony' > /etc/chrony.conf
|
||||
|
||||
systemctl enable chronyd.service && systemctl start chronyd.service
|
||||
```
|
||||
## Репозиторий Openstack
|
||||
```
|
||||
yum install centos-release-openstack-stein
|
||||
|
||||
yum upgrade
|
||||
|
||||
yum install python-openstackclient
|
||||
|
||||
yum install openstack-selinux
|
||||
```
|
||||
## SQL db
|
||||
```
|
||||
yum install mariadb mariadb-server python2-PyMySQL
|
||||
|
||||
echo '[mysqld]
|
||||
bind-address = 172.17.1.100
|
||||
default-storage-engine = innodb
|
||||
innodb_file_per_table
|
||||
max_connections = 15360
|
||||
collation-server = utf8_general_ci
|
||||
character-set-server = utf8
|
||||
key_buffer = 2048M
|
||||
max_allowed_packet = 2048M
|
||||
thread_stack = 512M
|
||||
thread_cache_size = 1024
|
||||
query_cache_limit = 128M
|
||||
query_cache_size = 256M
|
||||
innodb_buffer_pool_size = 4G
|
||||
innodb_flush_method = O_DIRECT' > /etc/my.cnf.d/openstack.cnf
|
||||
|
||||
systemctl enable mariadb.service && systemctl start mariadb.service
|
||||
|
||||
mysql_secure_installation
|
||||
```
|
||||
## MQ (RABBIT_PASS заменить на пароль)
|
||||
```
|
||||
yum install rabbitmq-server
|
||||
|
||||
systemctl enable rabbitmq-server.service && systemctl start rabbitmq-server.service
|
||||
|
||||
rabbitmqctl add_user openstack RABBIT_PASS
|
||||
|
||||
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
|
||||
```
|
||||
|
||||
## Memchched
|
||||
```
|
||||
yum install memcached python-memcached
|
||||
|
||||
echo 'PORT="11211"
|
||||
USER="memcached"
|
||||
MAXCONN="1024"
|
||||
CACHESIZE="64"
|
||||
OPTIONS="-l 172.17.1.100,::1"' > /etc/sysconfig/memcached
|
||||
|
||||
systemctl enable memcached.service && systemctl start memcached.service
|
||||
```
|
||||
|
||||
## Firewall
|
||||
```
|
||||
firewall-cmd --permanent --add-port={8082/tcp,8773/tcp,8774/tcp,8775/tcp,8776/tcp,8778/tcp,5900-5999/tcp,6080/tcp,6081/tcp,6082/tcp,5000/tcp,9292/tcp,9191/tcp,9696/tcp,9322/tcp,8777/tcp,80/tcp,8080/tcp,3306/tcp,11211/tcp,35357/tcp,5672/tcp,4789/udp,21/tcp,15000-15500/tcp,10050/tcp,15672/tcp,443/tcp,9180/tcp}
|
||||
|
||||
firewall-cmd --reload
|
||||
```
|
||||
|
||||
|
||||
# Миграция компонентов (MariaDB, RabbitMQ)
|
||||
## MariaDB
|
||||
Сделать дамп на старом контроллере
|
||||
```
|
||||
systemctl stop mariadb.service
|
||||
mysqldump -AY -u root -p > dump.sql
|
||||
```
|
||||
Импортировать данные на новом контроллере:
|
||||
```
|
||||
mysql -u root -p < dump.sql
|
||||
```
|
||||
|
||||
## RabbitMQ
|
||||
1) Зайти на http://172.17.1.100:15672/
|
||||
2) Залогиниться под пользователем dashboard_admin_user
|
||||
3) Воспользоваться Export definitions
|
||||
4) На новом контроллере установить плагин rabbitmq_management
|
||||
```
|
||||
rabbitmq-plugins enable rabbitmq_management
|
||||
```
|
||||
5) Импортировать json файл
|
||||
|
||||
# Keystone (KEYSTONE_DBPASS заменить на пароль):
|
||||
```
|
||||
yum install openstack-keystone httpd mod_wsgi
|
||||
|
||||
echo '[DEFAULT]
|
||||
use_syslog = True
|
||||
syslog_log_facility = LOG_LOCAL3
|
||||
[access_rules_config]
|
||||
[application_credential]
|
||||
[assignment]
|
||||
driver = sql
|
||||
[auth]
|
||||
[cache]
|
||||
enabled=true
|
||||
[catalog]
|
||||
caching=true
|
||||
[cors]
|
||||
[credential]
|
||||
[database]
|
||||
connection = mysql+pymysql://keystonedb:KEYSTONE_DBPASS@controller-virt/keystone
|
||||
[domain_config]
|
||||
caching=true
|
||||
[endpoint_filter]
|
||||
[endpoint_policy]
|
||||
[eventlet_server]
|
||||
[federation]
|
||||
caching=true
|
||||
[fernet_receipts]
|
||||
[fernet_tokens]
|
||||
[healthcheck]
|
||||
[identity]
|
||||
default_domain_id = default
|
||||
domain_specific_drivers_enabled = true
|
||||
domain_config_dir = /etc/keystone/domains
|
||||
[identity_mapping]
|
||||
[jwt_tokens]
|
||||
[ldap]
|
||||
[memcache]
|
||||
[oauth1]
|
||||
[oslo_messaging_amqp]
|
||||
[oslo_messaging_kafka]
|
||||
[oslo_messaging_notifications]
|
||||
[oslo_messaging_rabbit]
|
||||
[oslo_middleware]
|
||||
[oslo_policy]
|
||||
[policy]
|
||||
[profiler]
|
||||
[receipt]
|
||||
[resource]
|
||||
caching=true
|
||||
[revoke]
|
||||
caching=true
|
||||
[role]
|
||||
enabled=true
|
||||
[saml]
|
||||
[security_compliance]
|
||||
[shadow_users]
|
||||
[signing]
|
||||
[token]
|
||||
enabled=true
|
||||
provider = fernet
|
||||
[tokenless_auth]
|
||||
[trust]
|
||||
[unified_limit]
|
||||
[wsgi]' > /etc/keystone/keystone.conf
|
||||
```
|
||||
|
||||
## Настройка httpd
|
||||
```
|
||||
sed -i '/^ServerName */c\ServerName controller-virt-test' /etc/httpd/conf/httpd.conf
|
||||
|
||||
ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
|
||||
|
||||
echo 'Listen 5000
|
||||
|
||||
<VirtualHost *:5000>
|
||||
WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
|
||||
WSGIProcessGroup keystone-public
|
||||
WSGIScriptAlias / /usr/bin/keystone-wsgi-public
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
LimitRequestBody 114688
|
||||
<IfVersion >= 2.4>
|
||||
ErrorLogFormat "%{cu}t %M"
|
||||
</IfVersion>
|
||||
ErrorLog /var/log/httpd/keystone.log
|
||||
CustomLog /var/log/httpd/keystone_access.log combined
|
||||
|
||||
<Directory /usr/bin>
|
||||
<IfVersion >= 2.4>
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
<IfVersion < 2.4>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
|
||||
Alias /identity /usr/bin/keystone-wsgi-public
|
||||
<Location /identity>
|
||||
SetHandler wsgi-script
|
||||
Options +ExecCGI
|
||||
|
||||
WSGIProcessGroup keystone-public
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
</Location>
|
||||
<Directory *>
|
||||
<IfVersion >= 2.4>
|
||||
Options All
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
<IfVersion < 2.4>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Directory>' > /etc/httpd/conf.d/wsgi-keystone.conf
|
||||
|
||||
systemctl enable httpd.service && systemctl start httpd.service
|
||||
```
|
||||
|
||||
# Nova и Placement (RABBIT_PASS, NOVA_DBPASS, NOVA_PASS, NEUTRON_PASS, PLACEMENT_PASS заменить на пароли)
|
||||
```
|
||||
yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler openstack-nova-placement-api
|
||||
|
||||
echo '[DEFAULT]
|
||||
debug = False
|
||||
use_syslog = True
|
||||
syslog_log_facility = LOG_LOCAL0
|
||||
enable_instance_password = True
|
||||
enabled_apis = osapi_compute,metadata
|
||||
transport_url = rabbit://openstack:RABBIT_PASS@controller-virt
|
||||
my_ip = 172.17.1.100
|
||||
use_neutron = true
|
||||
firewall_driver = nova.virt.firewall.NoopFirewallDriver
|
||||
vnc_enabled = False
|
||||
novnc_enabled = False
|
||||
web = /usr/share/spice-html5
|
||||
[api]
|
||||
auth_strategy = keystone
|
||||
[api_database]
|
||||
connection = mysql+pymysql://novadb:NOVA_DBPASS@controller-virt/nova_api
|
||||
[barbican]
|
||||
[cache]
|
||||
[cells]
|
||||
[cinder]
|
||||
os_region_name = RegionOne
|
||||
[compute]
|
||||
[conductor]
|
||||
[console]
|
||||
[consoleauth]
|
||||
[cors]
|
||||
[database]
|
||||
connection = mysql+pymysql://novadb:NOVA_DBPASS@controller-virt/nova
|
||||
[devices]
|
||||
[ephemeral_storage_encryption]
|
||||
[filter_scheduler]
|
||||
enabled_filters = RetryFilter, ComputeFilter, ComputeCapabilitiesFilter, ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter, PciPassthroughFilter, AggregateMultiTenancyIsolation
|
||||
available_filters = nova.scheduler.filters.all_filters
|
||||
[glance]
|
||||
api_servers = http://controller-ceph:9292
|
||||
[guestfs]
|
||||
[healthcheck]
|
||||
[hyperv]
|
||||
[ironic]
|
||||
[key_manager]
|
||||
[keystone]
|
||||
[keystone_authtoken]
|
||||
auth_url = http://controller-virt:5000/v3
|
||||
memcached_servers = controller-virt:11211
|
||||
service_token_roles_required = False
|
||||
auth_type = password
|
||||
project_domain_name = Default
|
||||
user_domain_name = Default
|
||||
project_name = service
|
||||
username = nova
|
||||
password = NOVA_PASS
|
||||
[libvirt]
|
||||
inject_password=true
|
||||
inject_partition = -1
|
||||
[metrics]
|
||||
[mks]
|
||||
[neutron]
|
||||
url = http://controller-net:9696
|
||||
auth_url = http://controller-virt:5000/v3
|
||||
auth_type = password
|
||||
project_domain_name = Default
|
||||
user_domain_name = Default
|
||||
region_name = RegionOne
|
||||
project_name = service
|
||||
username = neutron
|
||||
password = NEUTRON_PASS
|
||||
service_metadata_proxy = True
|
||||
metadata_proxy_shared_secret = d11c44f2-df2b-4436-b8c1-55ba8dae6dc1
|
||||
[notifications]
|
||||
[osapi_v21]
|
||||
[oslo_concurrency]
|
||||
lock_path = /var/lib/nova/tmp
|
||||
[oslo_messaging_amqp]
|
||||
[oslo_messaging_kafka]
|
||||
[oslo_messaging_notifications]
|
||||
[oslo_messaging_rabbit]
|
||||
[oslo_middleware]
|
||||
[oslo_policy]
|
||||
[pci]
|
||||
alias = {"vendor_id": "10de", "product_id": "1c82", "device_type": "type-PCI", "name": "1050TI"}
|
||||
#alias = [{ "vendor_id":"10de", "product_id": "1c82", "device_type":"type-PCI", "name":"1050TI" }, {"vendor_id": "10de", "product_id": "1b06", "device_type": "type-PCI", "name": "1080TI"}]
|
||||
alias = {"vendor_id": "10de", "product_id": "1b06", "device_type": "type-PCI", "name": "1080TI"}
|
||||
[placement]
|
||||
region_name = RegionOne
|
||||
project_domain_name = Default
|
||||
project_name = service
|
||||
auth_type = password
|
||||
user_domain_name = Default
|
||||
auth_url = http://controller-virt:5000/v3
|
||||
username = placement
|
||||
password = PLACEMENT_PASS
|
||||
[placement_database]
|
||||
[powervm]
|
||||
[privsep]
|
||||
[profiler]
|
||||
[quota]
|
||||
[rdp]
|
||||
[remote_debug]
|
||||
[scheduler]
|
||||
[serial_console]
|
||||
[service_user]
|
||||
[spice]
|
||||
enabled = True
|
||||
html5proxy_host = 172.17.1.100
|
||||
html5proxy_port = 6082
|
||||
keymap = en-us
|
||||
[upgrade_levels]
|
||||
[vault]
|
||||
[vendordata_dynamic_auth]
|
||||
[vmware]
|
||||
[vnc]
|
||||
enabled = True
|
||||
server_listen = $my_ip
|
||||
server_proxyclient_address = $my_ip
|
||||
[workarounds]
|
||||
[wsgi]
|
||||
[xenserver]
|
||||
[xvp]
|
||||
[zvm]' > /etc/nova/nova.conf
|
||||
```
|
||||
|
||||
## Настройка httpd
|
||||
```
|
||||
echo `Listen 172.17.1.100:8778
|
||||
|
||||
<VirtualHost *:8778>
|
||||
WSGIProcessGroup placement-api
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
WSGIDaemonProcess placement-api processes=3 threads=1 user=placement group=placement
|
||||
WSGIScriptAlias / /usr/bin/placement-api
|
||||
<IfVersion >= 2.4>
|
||||
ErrorLogFormat "%M"
|
||||
</IfVersion>
|
||||
ErrorLog /var/log/placement/placement-api.log
|
||||
#SSLEngine On
|
||||
#SSLCertificateFile ...
|
||||
#SSLCertificateKeyFile ...
|
||||
</VirtualHost>
|
||||
|
||||
Alias /placement-api /usr/bin/placement-api
|
||||
<Location /placement-api>
|
||||
SetHandler wsgi-script
|
||||
Options +ExecCGI
|
||||
WSGIProcessGroup placement-api
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
</Location>` > /etc/httpd/conf.d/00-placement-api.conf
|
||||
|
||||
systemctl restart httpd
|
||||
```
|
||||
|
||||
## Запуск nova
|
||||
```
|
||||
systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service && systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
|
||||
```
|
||||
|
||||
# Horizon
|
||||
```
|
||||
yum install openstack-dashboard
|
||||
|
||||
echo "# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from openstack_dashboard.settings import HORIZON_CONFIG
|
||||
|
||||
DEBUG = False
|
||||
WEBROOT = '/dashboard'
|
||||
ALLOWED_HOSTS = ['cloud.resds.ru', 'localhost']
|
||||
USE_SSL = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
SESSION_COOKIE_SECURE = True
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
OPENSTACK_API_VERSIONS = {
|
||||
'identity': 3,
|
||||
'image': 2,
|
||||
'volume': 3,
|
||||
'compute': 2,
|
||||
}
|
||||
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
|
||||
OPENSTACK_KEYSTONE_DOMAIN_DROPDOWN = True
|
||||
OPENSTACK_KEYSTONE_DOMAIN_CHOICES = (
|
||||
('default', 'Default'),
|
||||
('AD', 'AD'),
|
||||
)
|
||||
SHOW_OPENRC_FILE = True
|
||||
SHOW_OPENSTACK_CLOUDS_YAML = True
|
||||
HORIZON_CONFIG['password_autocomplete'] = 'off'
|
||||
LOCAL_PATH = '/tmp'
|
||||
SECRET_KEY='59858e76cc46d234e20d'
|
||||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
|
||||
'LOCATION': 'controller-virt:11211',
|
||||
}
|
||||
}
|
||||
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
OPENSTACK_HOST = 'controller-virt'
|
||||
OPENSTACK_KEYSTONE_URL = 'http://%s:5000/v3' % OPENSTACK_HOST
|
||||
OPENSTACK_KEYSTONE_DEFAULT_ROLE = 'member'
|
||||
OPENSTACK_KEYSTONE_BACKEND = {
|
||||
'name': 'native',
|
||||
'can_edit_user': True,
|
||||
'can_edit_group': True,
|
||||
'can_edit_project': True,
|
||||
'can_edit_domain': True,
|
||||
'can_edit_role': True,
|
||||
}
|
||||
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = True
|
||||
LAUNCH_INSTANCE_NG_ENABLED = True
|
||||
OPENSTACK_HYPERVISOR_FEATURES = {
|
||||
'can_set_mount_point': False,
|
||||
'can_set_password': True,
|
||||
'requires_keypair': False,
|
||||
'enable_quotas': True
|
||||
}
|
||||
OPENSTACK_CINDER_FEATURES = {
|
||||
'enable_backup': False,
|
||||
}
|
||||
OPENSTACK_NEUTRON_NETWORK = {
|
||||
'enable_router': True,
|
||||
'enable_quotas': True,
|
||||
'enable_ipv6': False,
|
||||
'enable_distributed_router': False,
|
||||
'enable_ha_router': False,
|
||||
'enable_fip_topology_check': True,
|
||||
'supported_vnic_types': ['*'],
|
||||
'physical_networks': [],
|
||||
}
|
||||
OPENSTACK_HEAT_STACK = {
|
||||
'enable_user_pass': True,
|
||||
}
|
||||
IMAGE_CUSTOM_PROPERTY_TITLES = {
|
||||
'architecture': _('Architecture'),
|
||||
'kernel_id': _('Kernel ID'),
|
||||
'ramdisk_id': _('Ramdisk ID'),
|
||||
'image_state': _('Euca2ools state'),
|
||||
'project_id': _('Project ID'),
|
||||
'image_type': _('Image Type'),
|
||||
}
|
||||
IMAGE_RESERVED_CUSTOM_PROPERTIES = []
|
||||
API_RESULT_LIMIT = 1000
|
||||
API_RESULT_PAGE_SIZE = 20
|
||||
SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024
|
||||
INSTANCE_LOG_LENGTH = 35
|
||||
DROPDOWN_MAX_ITEMS = 30
|
||||
TIME_ZONE = 'Europe/Moscow'
|
||||
POLICY_FILES_PATH = '/etc/openstack-dashboard'
|
||||
AVAILABLE_THEMES = [
|
||||
('default', 'Default', 'themes/default'),
|
||||
('openstack', 'Openstack', 'themes/openstack'),
|
||||
('material', 'Material', 'themes/material'),
|
||||
]
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'formatters': {
|
||||
'console': {
|
||||
'format': '%(levelname)s %(name)s %(message)s'
|
||||
},
|
||||
'operation': {
|
||||
|
||||
|
||||
'format': '%(message)s'
|
||||
},
|
||||
},
|
||||
'handlers': {
|
||||
'null': {
|
||||
'level': 'DEBUG',
|
||||
'class': 'logging.NullHandler',
|
||||
},
|
||||
'console': {
|
||||
|
||||
'level': 'INFO',
|
||||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'console',
|
||||
},
|
||||
'operation': {
|
||||
'level': 'INFO',
|
||||
'class': 'logging.StreamHandler',
|
||||
'formatter': 'operation',
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
'horizon': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'horizon.operation_log': {
|
||||
'handlers': ['operation'],
|
||||
'level': 'INFO',
|
||||
'propagate': False,
|
||||
},
|
||||
'openstack_dashboard': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'novaclient': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'cinderclient': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'keystoneauth': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'keystoneclient': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'glanceclient': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'neutronclient': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'swiftclient': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'oslo_policy': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'openstack_auth': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'django': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'django.db.backends': {
|
||||
'handlers': ['null'],
|
||||
'propagate': False,
|
||||
},
|
||||
'requests': {
|
||||
'handlers': ['null'],
|
||||
'propagate': False,
|
||||
},
|
||||
'urllib3': {
|
||||
'handlers': ['null'],
|
||||
'propagate': False,
|
||||
},
|
||||
'chardet.charsetprober': {
|
||||
'handlers': ['null'],
|
||||
'propagate': False,
|
||||
},
|
||||
'iso8601': {
|
||||
'handlers': ['null'],
|
||||
'propagate': False,
|
||||
},
|
||||
'scss': {
|
||||
'handlers': ['null'],
|
||||
'propagate': False,
|
||||
},
|
||||
},
|
||||
}
|
||||
SECURITY_GROUP_RULES = {
|
||||
'all_tcp': {
|
||||
'name': _('All TCP'),
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '1',
|
||||
'to_port': '65535',
|
||||
},
|
||||
'all_udp': {
|
||||
'name': _('All UDP'),
|
||||
'ip_protocol': 'udp',
|
||||
'from_port': '1',
|
||||
'to_port': '65535',
|
||||
},
|
||||
'all_icmp': {
|
||||
'name': _('All ICMP'),
|
||||
'ip_protocol': 'icmp',
|
||||
'from_port': '-1',
|
||||
'to_port': '-1',
|
||||
},
|
||||
'ssh': {
|
||||
'name': 'SSH',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '22',
|
||||
'to_port': '22',
|
||||
},
|
||||
'smtp': {
|
||||
'name': 'SMTP',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '25',
|
||||
'to_port': '25',
|
||||
},
|
||||
'dns': {
|
||||
'name': 'DNS',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '53',
|
||||
'to_port': '53',
|
||||
},
|
||||
'http': {
|
||||
'name': 'HTTP',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '80',
|
||||
'to_port': '80',
|
||||
},
|
||||
'pop3': {
|
||||
'name': 'POP3',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '110',
|
||||
'to_port': '110',
|
||||
},
|
||||
'imap': {
|
||||
'name': 'IMAP',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '143',
|
||||
'to_port': '143',
|
||||
},
|
||||
'ldap': {
|
||||
'name': 'LDAP',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '389',
|
||||
'to_port': '389',
|
||||
},
|
||||
'https': {
|
||||
'name': 'HTTPS',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '443',
|
||||
'to_port': '443',
|
||||
},
|
||||
'smtps': {
|
||||
'name': 'SMTPS',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '465',
|
||||
'to_port': '465',
|
||||
},
|
||||
'imaps': {
|
||||
'name': 'IMAPS',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '993',
|
||||
'to_port': '993',
|
||||
},
|
||||
'pop3s': {
|
||||
'name': 'POP3S',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '995',
|
||||
'to_port': '995',
|
||||
},
|
||||
'ms_sql': {
|
||||
'name': 'MS SQL',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '1433',
|
||||
'to_port': '1433',
|
||||
},
|
||||
'mysql': {
|
||||
'name': 'MYSQL',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '3306',
|
||||
'to_port': '3306',
|
||||
},
|
||||
'rdp': {
|
||||
'name': 'RDP',
|
||||
'ip_protocol': 'tcp',
|
||||
'from_port': '3389',
|
||||
'to_port': '3389',
|
||||
},
|
||||
}
|
||||
REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES',
|
||||
'LAUNCH_INSTANCE_DEFAULTS',
|
||||
'OPENSTACK_IMAGE_FORMATS',
|
||||
'OPENSTACK_KEYSTONE_BACKEND',
|
||||
'OPENSTACK_KEYSTONE_DEFAULT_DOMAIN',
|
||||
'CREATE_IMAGE_DEFAULTS',
|
||||
'ENFORCE_PASSWORD_CHECK']
|
||||
ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []}" > /etc/openstack-dashboard/local_settings
|
||||
|
||||
echo '<VirtualHost *:80>
|
||||
ServerName cloud.resds.ru
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTPS} off
|
||||
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
|
||||
</IfModule>
|
||||
<IfModule !mod_rewrite.c>
|
||||
RedirectPermanent / https://cloud.resds.ru/dashboard
|
||||
</IfModule>
|
||||
</VirtualHost>
|
||||
<VirtualHost *:443>
|
||||
ServerName cloud.resds.ru
|
||||
SSLEngine On
|
||||
SSLCertificateFile /etc/letsencrypt/live/cloud.resds.ru/cert.pem
|
||||
SSLCACertificateFile /etc/letsencrypt/live/cloud.resds.ru/chain.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/cloud.resds.ru/privkey.pem
|
||||
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
|
||||
Header add Strict-Transport-Security "max-age=15768000"
|
||||
WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
|
||||
WSGIDaemonProcess dashboard user=apache group=apache processes=9 threads=30
|
||||
|
||||
Alias /dashboard/static /usr/share/openstack-dashboard/static
|
||||
<Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
|
||||
<IfVersion >= 2.4>
|
||||
Options All
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
<IfVersion < 2.4>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Directory>
|
||||
<Directory /usr/share/openstack-dashboard/static>
|
||||
<IfVersion >= 2.4>
|
||||
Options All
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
<IfVersion < 2.4>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Directory>
|
||||
</VirtualHost>' > /etc/httpd/conf.d/openstack-dashboard.conf
|
||||
|
||||
echo 'RedirectMatch ^/$ https://cloud.resds.ru/dashboard/' > /etc/httpd/conf.d/welcome.conf
|
||||
|
||||
systemctl restart httpd.service memcached.service
|
||||
```
|
||||
|
||||
## Интеграция с AD
|
||||
```
|
||||
sed -i '/^import sys/a reload(sys)\nsys.setdefaultencoding('UTF8')' /usr/lib/python2.7/site-packages/keystone/identity/backends/ldap/common.py
|
||||
```
|
||||
|
||||
## Стилизация дашборда (TODO: openstack-dashboard.tar.gz link)
|
||||
```
|
||||
wget link
|
||||
tar -xzvf openstack-dashboard.tar.gz --overwrite -C /usr/share/
|
||||
```
|
||||
Reference in New Issue
Block a user