├── 7.Image ├── 11.Edit-image.md ├── data │ ├── Build-2 │ │ ├── netplug-1.2.9.2.tar.bz2 │ │ ├── netplug-1.2.9.2-man.patch │ │ ├── netplug-1.2.9.1-init.patch │ │ └── netplug.spec │ ├── netplug-1.2.9.2-4.el7.x86_64.rpm │ ├── netplug-debuginfo-1.2.9.2-4.el7.x86_64.rpm │ └── netplug-cent6 ├── 22.IPv6-rocky.md ├── 12. Redhat-8.md ├── 5.Ubuntu-16.md └── 3.Centos-7.md ├── _config.yml ├── .github └── FUNDING.yml ├── Neutron ├── Untitled Diagram.png ├── 13. VXLAN-Update.md ├── 8. OpenvSwitch-OPS.md ├── 12. VXLAN-Tunnel-Host-pair-OPS.md ├── 10. OPS-Packet-Provider.md ├── 11. VXLAN-Tunnel.md └── 4. Neutron-Namespace-Agent.md ├── Book ├── OpenStack-Summit-Vancouver-Workshop.pdf └── Readme.md ├── Release └── 1.Stein.md ├── High-availability ├── Scale-out-RabbitMQ-cluster-can-improve-performance-while-keeping-high-availability..pdf ├── Test │ └── 1.Apache-Bench.md ├── 7. Cluster-Openstack │ ├── Pacemaker │ │ ├── Setup_phase │ │ │ └── 1.ENV │ │ │ │ └── othernode.md │ │ ├── 8.Cinder-StorageNode.md │ │ ├── 5.Nova-compute.md │ │ ├── 7.Cinder-controller.md │ │ ├── 2.Keystone.md │ │ └── 3.Glance.md │ ├── KeepAlived │ │ ├── Setup_phase │ │ │ └── 1.ENV │ │ │ │ └── othernode.md │ │ ├── 8.Cinder-StorageNode.md │ │ ├── 7.Cinder-controller.md │ │ ├── 5.Nova-compute.md │ │ ├── 2.Keystone.md │ │ └── 3.Glance.md │ └── 3. HAproxy-log.md ├── 3. Pacemaker │ ├── corosync.md │ ├── 6. Pacemaker-Alert.md │ └── 4. Pacemaker-Apache-Active-Passive.md ├── 4. Database │ └── 4. Check-status.md ├── 5. Message-Queue │ ├── 2. Rabbit-MQ-Cluser-Recovery.md │ └── 1.RabbitMQ-Cluster.md ├── 2. Octavia │ ├── 4 .VIP-QOS.md │ ├── 5.Theory-Octavia-L7-Policy.md │ └── 6. LAB-Octavia-L7-Policy.md ├── 1. Introduction-HA.md ├── 6. Tunning.md └── 1.HA-Proxy---KeepAlive │ └── 5. HAproxy-ACL.md ├── Nova ├── 5. Debug.md ├── 6. Config-section.md ├── 7.Live-migration.md ├── 4. Nova-Instance-Work-flow.md ├── 1.Introduction-nova.md └── 3.Nova-Client&Curl.md ├── Kolla-ansible ├── 1.1.Monitor-VM-kolla.md └── 1.Wallaby.md ├── Keystone ├── 3. Architecture-Keystone( additional ).md ├── 8.Multi-domain.md └── 9.Policy.md ├── Advance ├── 3. Log.md ├── 2.RabbitMQ-&-API-Endpoint.md ├── 10. Limit-CPU-Resource.md ├── 9. Rescue-instance.md ├── 12. Cloud-init.md ├── 20. Nova-password.md ├── 8. Resize-instance.md ├── 18. L3-Agent-HA-Compute.md ├── 4. Setup-noVNC.md ├── 1. Key-Rotate-&-Decrypt.md ├── 21.Advance-Rocky.md └── 7.3. Lab-Filter-Scheduler.md ├── Cloud-init └── Network.md ├── Horizon └── Introduction-horizon.md ├── Glance └── 4. Config.md ├── Cinder ├── 5. Install-Multi-Backend.md └── 1. Introduction-cinder.md └── 1. Intro Cloud Computing.md /7.Image/11.Edit-image.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: nguyenhungsync 4 | -------------------------------------------------------------------------------- /Neutron/Untitled Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hungnt1/Openstack_Research/HEAD/Neutron/Untitled Diagram.png -------------------------------------------------------------------------------- /7.Image/data/Build-2/netplug-1.2.9.2.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hungnt1/Openstack_Research/HEAD/7.Image/data/Build-2/netplug-1.2.9.2.tar.bz2 -------------------------------------------------------------------------------- /7.Image/data/netplug-1.2.9.2-4.el7.x86_64.rpm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hungnt1/Openstack_Research/HEAD/7.Image/data/netplug-1.2.9.2-4.el7.x86_64.rpm -------------------------------------------------------------------------------- /Book/OpenStack-Summit-Vancouver-Workshop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hungnt1/Openstack_Research/HEAD/Book/OpenStack-Summit-Vancouver-Workshop.pdf -------------------------------------------------------------------------------- /7.Image/data/netplug-debuginfo-1.2.9.2-4.el7.x86_64.rpm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hungnt1/Openstack_Research/HEAD/7.Image/data/netplug-debuginfo-1.2.9.2-4.el7.x86_64.rpm -------------------------------------------------------------------------------- /Release/1.Stein.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Nova 4 | 5 | 6 | ![](https://i.imgur.com/tL9b8tC.pngfa) 7 | 8 | 9 | ## Neutron 10 | 11 | ![](https://i.imgur.com/ht1MbmX.png) 12 | 13 | 14 | -------------------------------------------------------------------------------- /High-availability/Scale-out-RabbitMQ-cluster-can-improve-performance-while-keeping-high-availability..pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hungnt1/Openstack_Research/HEAD/High-availability/Scale-out-RabbitMQ-cluster-can-improve-performance-while-keeping-high-availability..pdf -------------------------------------------------------------------------------- /High-availability/Test/1.Apache-Bench.md: -------------------------------------------------------------------------------- 1 | # 1 .Apache HTTP server benchmarking tool 2 | 3 | 4 | ``` 5 | ab -n 1000 -c 100 http://192.168.50.140/dashboard 6 | ``` 7 | 8 | - Yêu cầu gửi 1000 request tới `http://192.168.50.140/dashboard ` 9 | - Gửi 100 request trên 1 lần cho đến khi hết 1000 request yêu cầu -------------------------------------------------------------------------------- /Neutron/13. VXLAN-Update.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Get OVS VNI 4 | 5 | 6 | - Kiến trúc 7 | 8 | ![](https://i.imgur.com/wtMqrRr.png) 9 | 10 | ![](https://i.imgur.com/oryCXAi.png) 11 | 12 | 13 | ## TAP Device 14 | 15 | - Kiểm tra MAC của instance 16 | ![](https://i.imgur.com/tvZDmip.png) 17 | 18 | 19 | - Kiểm tra trên compute node, tại domain instance file sẽ thấy MAC Address và TAP tương ứng 20 | ![](https://i.imgur.com/G0cWT4b.png) 21 | 22 | ## veth pair LB <---> br-int 23 | 24 | - Kiểm tra interface trên Comptue node 25 | 26 | ![](https://i.imgur.com/nqiliSl.png) 27 | 28 | - Check : 29 | 30 | ![](https://i.imgur.com/g3BUxof.png) -------------------------------------------------------------------------------- /Nova/5. Debug.md: -------------------------------------------------------------------------------- 1 | 2 | ## Debug trong Nova 3 | 4 | - LIVE MIGRATION : virsh qemu-monitor-command, virsh qemu-monitor-eve 5 | - If the instance crashes – coredump : virsh dump 6 | - Enable libvirt logging for understanding lower level interactions between libvirt and qemu 7 | - libvirtd.conf 8 | - log_filters="1:libvirt 1:qemu 1:conf 1:security 3:event 3:json 3:file 3:object 1:util 1:qemu_monitor" 9 | - log_outputs="1:file:/var/log/libvirt/libvirtd.log 10 | - sed -i 's/debug=False/debug=True/g' /etc/nova/nova.conf 11 | - sed -i 's/verbose=False/verbose=True/g' /etc/nova/nova.conf 12 | - Get compute.log, conductor.log, scheduler.log for analysis 13 | -------------------------------------------------------------------------------- /High-availability/7. Cluster-Openstack/Pacemaker/Setup_phase/1.ENV/othernode.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Cấu hình môi trường node Compute và Storage Node 4 | 5 | 6 | ## 1. Openstack Package 7 | 8 | 9 | - Cài đặt Openstack Rocky Repository 10 | 11 | ``` 12 | yum install -y centos-release-openstack-rocky 13 | yum upgrade -y 14 | ``` 15 | 16 | 17 | 18 | ## 2. NTP 19 | 20 | - Cài đặt chrony 21 | 22 | ``` 23 | yum install -y chrony 24 | ``` 25 | 26 | - Cấu hình NTP ( sử dụng Pacemaker VIP) 27 | 28 | ``` 29 | sed -i "s/server.*/server 192.168.50.140 iburst/g" /etc/chrony.conf 30 | systemctl enable chronyd.service 31 | systemctl restart chronyd.service 32 | ``` 33 | 34 | END. -------------------------------------------------------------------------------- /High-availability/7. Cluster-Openstack/KeepAlived/Setup_phase/1.ENV/othernode.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Cấu hình môi trường node Compute và Storage Node 4 | 5 | 6 | ## 1. Openstack Package 7 | 8 | 9 | - Cài đặt Openstack Rocky Repository 10 | 11 | ``` 12 | yum install -y centos-release-openstack-rocky 13 | yum upgrade -y 14 | ``` 15 | 16 | 17 | 18 | ## 2. NTP 19 | 20 | - Cài đặt chrony 21 | 22 | ``` 23 | yum install -y chrony 24 | ``` 25 | 26 | - Cấu hình NTP ( sử dụng Pacemaker VIP) 27 | 28 | ``` 29 | sed -i "s/server.*/server 192.168.50.140 iburst/g" /etc/chrony.conf 30 | systemctl enable chronyd.service 31 | systemctl restart chronyd.service 32 | ``` 33 | 34 | END. -------------------------------------------------------------------------------- /High-availability/3. Pacemaker/corosync.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | - Tập tin cấu hình Corosync 4 | ``` 5 | totem { 6 | version: 2 7 | cluster_name: hacluster 8 | secauth: off 9 | transport: udpu 10 | } 11 | 12 | nodelist { 13 | node { 14 | ring0_addr: 192.168.69.130 15 | nodeid: 1 16 | } 17 | 18 | node { 19 | ring0_addr: 192.168.69.131 20 | nodeid: 2 21 | } 22 | 23 | node { 24 | ring0_addr: 192.168.69.132 25 | nodeid: 3 26 | } 27 | } 28 | 29 | quorum { 30 | provider: corosync_votequorum 31 | } 32 | 33 | logging { 34 | to_logfile: yes 35 | logfile: /var/log/cluster/corosync.log 36 | to_syslog: yes 37 | 38 | ``` 39 | -------------------------------------------------------------------------------- /Book/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | - Blog OpenStack Operator 3 | 4 | ``` 5 | https://clouddocs.web.cern.ch/index.html 6 | http://openstack-in-production.blogspot.com/ 7 | 8 | ``` 9 | 10 | - OpenStack Multi Region 11 | - ``` 12 | https://beyondtheclouds.github.io/blog/openstack/cockroachdb/2018/06/04/evaluation-of-openstack-multi-region-keystone-deployments.html 13 | `````` 14 | 15 | - OpenStack COA Cert Requirement 16 | ``` 17 | https://www.openstack.org/coa/requirements 18 | ``` 19 | 20 | - OpenStack Live Migrate and Cold Migrate 21 | ``` 22 | http://www.panticz.de/openstack-server-migrate 23 | ``` 24 | 25 | - OpenStack Automatic Snapshot with crontab 26 | ``` 27 | https://github.com/houtknots/Openstack-Automatic-Snapshot 28 | ``` -------------------------------------------------------------------------------- /Kolla-ansible/1.1.Monitor-VM-kolla.md: -------------------------------------------------------------------------------- 1 | 2 | ## on compute host 3 | - Monitor openstack VM with prometheus and exporter libvirt 4 | 5 | 6 | - excute on host OS 7 | 8 | - create service 9 | ``` 10 | 11 | 12 | sudo vi /etc/systemd/system/vm_exporter.service 13 | 14 | [Unit] 15 | Description=OpensStack VM Exporter 16 | After=network.target 17 | 18 | [Service] 19 | User=root 20 | Group=root 21 | Type=simple 22 | Restart=always 23 | ExecStart=/usr/local/bin/prometheus-libvirt-exporter --libvirt.uri /var/run/libvirt/libvirt-sock-ro --libvirt.driver qemu:///system --web.listen-address :9777 24 | 25 | [Install] 26 | WantedBy=multi-user.target 27 | ``` 28 | 29 | - Enable and start exporter 30 | ``` 31 | sudo systemctl daemon-reload 32 | sudo systemctl start vm_exporter 33 | sudo systemctl enable vm_exporter 34 | 35 | ``` 36 | 37 | - check metrics 38 | ``` 39 | curl http://localhost:9777/metrics 40 | ``` -------------------------------------------------------------------------------- /Keystone/3. Architecture-Keystone( additional ).md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # 1. Kiến trúc trong Keystone ( bổ sung ) 5 | 6 | - Keystone được xem là một giao diện HTTP cho nhiều service khác. . Giống như các service khác, keystone được xây dựng từ WSGI,. Những endpoint của Keystone được xây dựng bởi pipeline của WSGI middeware 7 | 8 | - Mỗi một services có thể cấu hình một backen để cho phép keystone có thể làm việc với các môi trường, mục đích khác nhau 9 | - Keystone được phát triển để đảm nhiệm nhiều nhiệm vụ với nhiều phần bỗ trợ khác nhau. Như vật nhiều phương thức và kiểu dữ liệu sẽ được diễn ra trong quá trình làm việc để làm việc với backend. Một data-model cho phép tạo liên kết giữa các bảng. 10 | - Service trong hệ thống sẽ có các action khác nhau, có thể dùng `## Policy` để kiếm soát user có thể thực hiện hành động đó không không 11 | - Có thể đưa ra một list rule hướng kiểm tra, chỉ cần xác minh các credintal đúng yêu cầu thì sẽ được cấp quyền thực hiện. 12 | -------------------------------------------------------------------------------- /High-availability/4. Database/4. Check-status.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## List command 4 | 5 | ``` 6 | SHOW ENGINE INNODB STATUS\G; 7 | SHOW FULL PROCESSLIST; 8 | wsrep_sst_rsync --role 'donor' --address '192.168.50.131:4444/rsync_sst' 9 | SHOW VARIABLES LIKE 'wait_timeout'; 10 | SHOW GLOBAL VARIABLES LIKE "%vers%"; 11 | SHOW GLOBAL VARIABLES LIKE "%connect%"; 12 | SHOW GLOBAL STATUS LIKE "%connect%"; 13 | SHOW GLOBAL VARIABLES LIKE "%clean%"; 14 | SHOW GLOBAL VARIABLES LIKE "%max%"; 15 | SHOW GLOBAL VARIABLES LIKE "%thread%"; 16 | SHOW GLOBAL STATUS LIKE "%thread%"; 17 | 18 | ``` 19 | 20 | - Cài đặt MYSQL Tunner 21 | ``` 22 | wget http://mysqltuner.pl/ -O mysqltuner.pl 23 | wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt 24 | wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv 25 | perl mysqltuner.pl 26 | ``` 27 | 28 | 29 | - https://www.linode.com/docs/databases/mysql/how-to-optimize-mysql-performance-using-mysqltuner/ -------------------------------------------------------------------------------- /7.Image/data/Build-2/netplug-1.2.9.2-man.patch: -------------------------------------------------------------------------------- 1 | diff -up netplug-1.2.9.2/man/man8/netplugd.8.man netplug-1.2.9.2/man/man8/netplugd.8 2 | --- netplug-1.2.9.2/man/man8/netplugd.8.man 2008-12-23 00:36:23.000000000 +0100 3 | +++ netplug-1.2.9.2/man/man8/netplugd.8 2013-02-25 15:20:13.759315644 +0100 4 | @@ -134,7 +134,7 @@ to run in the foreground, this option is 5 | .\" 6 | .Sh FILES 7 | .Bl -tag -width Ds 8 | -.It Pa /etc/netplug/netplugd.conf 9 | +.It Pa /etc/netplug.d/netplugd.conf 10 | Default config file to read, if none is specified on the command line. 11 | The config file format is one pattern per line, with white space, 12 | empty lines, and comments starting with a 13 | @@ -165,13 +165,6 @@ can generate 14 | events. The command is run synchronously; it must exit with status 15 | code 0 if it succeeds, otherwise with a non-zero exit code or signal. 16 | .El 17 | -.It Pa /etc/rc.d/init.d/netplugd 18 | -The 19 | -.Xr init 8 20 | -script that starts, stops, and displays status of the 21 | -.Nm 22 | -daemon. 23 | -.El 24 | .\" 25 | .\" 26 | .Sh AUTHOR 27 | -------------------------------------------------------------------------------- /Keystone/8.Multi-domain.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ## Multi Domain 5 | 6 | 7 | - Domain trong keystone được hiểu là các zone trong quá trình xác thực. Các zone ( domain ) này như một vách ngăn 3 thành phần gồm : users, groups, domain. Mặc định trong OPS sẽ có một zone xây dựng sẵn là Default, domain này được khuyến nghị để chỉ cho các service account, và sẽ khởi tạo zone mới cho người dùng trong hệ sinh thái. 8 | 9 | - Khởi tạo Domain mới 10 | ``` 11 | openstack domain create Domain2 12 | ``` 13 | 14 | - Liệt kê danh sách domain 15 | ``` 16 | openstack domain list 17 | ``` 18 | 19 | - Enable và disable domain 20 | ``` 21 | openstack domain set Domain2 --disable 22 | openstack domain set Domain2 --enable 23 | ``` 24 | 25 | - Khởi tạo Project trong domain 26 | ``` 27 | openstack project create --domain Domain2 --description "User Project" admin 28 | ``` 29 | 30 | - Khởi tạo User trong Domain 31 | ``` 32 | openstack user create --domain Domain2 --password 1 admin 33 | ``` 34 | 35 | - Gán quyền admin cho User 36 | ``` 37 | openstack role add --project admin --project-domain Domain2 --user admin --user-domain Domain2 admin 38 | ``` -------------------------------------------------------------------------------- /7.Image/22.IPv6-rocky.md: -------------------------------------------------------------------------------- 1 | 2 | ## 1. IPv6 Controll Mode 3 | 4 | - IPV6 subnet trên Neutron cung cấp 2 attributes bao gồm : 5 | - ipv6_ra_mode : quản lý RA cho subnet (Routing Advertise) ( có thể là từ Openstack Router hoặc Router ngoài ) 6 | - ipv6_address_mode: xác định cách instances nhận địa chỉ IPv6, default gateway và các tài nguyên TCP/IP khác. 7 | 8 | 9 | - IPv6 trên neutron cung cấp ba cách để một instance nhận cấu hình địa chỉ IP và các cấu hình khác nhau 10 | - Stateless Address Auto Configuration (SLAAC) : tất cả cấu hình sẽ nhận từ RA 11 | - DHCPv6-stateless : Địa chỉ IP sẽ nhận từ RA, các cấu hình khác nhận từ DHCPv6 12 | - DHCPv6-statfull : tất cả cấu hình nhận từ DHCPv6 13 | ## Dataplane 14 | 15 | - Both the Linux bridge and the Open vSwitch dataplane modules support forwarding IPv6 packets amongst the guests and router ports. Similar to IPv4, there is no special configuration or setup required to enable the dataplane to properly forward packets from the source to the destination using IPv6. Note that these dataplanes will forward Link-local Address (LLA) packets between hosts on the same network just fine without any participation or setup by OpenStack components after the ports are all connected and MAC addresses learned. 16 | 17 | 18 | 19 | - https://docs.openstack.org/neutron/rocky/admin/config-ipv6.html -------------------------------------------------------------------------------- /Advance/3. Log.md: -------------------------------------------------------------------------------- 1 | 2 | ## Log trong OPS 3 | 4 | 5 | ## 1. Thư mục log mặc định 6 | 7 | Trên Controller Node 8 | 9 | - **Compute nova-*** 10 | _/var/log/nova_ 11 | 12 | - **Image Service glance-*** 13 | _/var/log/glance_ 14 | 15 | - **Block Storage cinder-*** 16 | _/var/log/cinder_ 17 | 18 | - **Identity service keystone-*** 19 | _/var/log/keystone_ 20 | 21 | - **Networking neutron-*** 22 | _/var/log/neutron_ 23 | 24 | - **Dashboard horizon** 25 | _/var/log/apache2 hoặc /var/log/httpd_ 26 | 27 | - **Orchestration service heat** 28 | _/var/log/heat_ 29 | 30 | - **Telemetry service ceilometer** 31 | _/var/log/ceilometer_ 32 | 33 | 34 | Trên Compute Node : 35 | 36 | - **Nova Compute ** 37 | _/var/log/nova/nova-compute.log_ 38 | 39 | - **Linux Bridge Agent** 40 | _/var/log/neutron/linuxbridge-agent.log_ 41 | 42 | - **Compute nodes libvirt** 43 | _/var/log/libvirt/libvirtd.log_ 44 | 45 | - _**Compute nodes Console (boot upmessages) for VM instances:**_/var/lib/nova/instances/instance-/console.log_ 46 | 47 | Trên Block Storage Node ; 48 | - **Block Storage nodes cinder-volume** 49 | _/var/log/cinder/cinder-volume.log_ 50 | 51 | 52 | ## 2. Cấu hình Syslog 53 | 54 | - Để cấu hình các message log sẽ được gửi đến syslog cấu hình trên từng service 55 | 56 | ``` 57 | [DEFAULT] 58 | debug = False 59 | use_syslog = True 60 | syslog_log_facility = LOG_LOCAL0 61 | ``` 62 | -------------------------------------------------------------------------------- /Cloud-init/Network.md: -------------------------------------------------------------------------------- 1 | 2 | ## Cấu hình không cho phép cloud-init tự động cấu hình network 3 | - Bình thường cloud-init sẽ tự động khởi tạo các file cấu hình ifupdown trên máy VM Centos 7.x, việc này có thể gây một số cản trờ trong quá trình VM sử dụng 4 | ``` 5 | [root@centos-c ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 6 | # Created by cloud-init on instance boot automatically, do not edit. 7 | # 8 | BOOTPROTO=dhcp 9 | DEVICE=eth0 10 | HWADDR=fa:16:3e:47:c9:64 11 | ONBOOT=yes 12 | TYPE=Ethernet 13 | USERCTL=no 14 | 15 | ``` 16 | 17 | - Để ngăn chặn việc cloud-init tự động khởi tạo file cấu hình, khi đóng template cho openstack cần cấu hình thêm 18 | ``` 19 | echo "network: {config: disabled}" | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg 20 | ``` 21 | - Và tạo thêm file cấu hình cho eth0 ( cái này tùy vào driver, virtio thì sẽ là eth0) trong template như sau 22 | 23 | ``` 24 | [root@centos-c ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 25 | BOOTPROTO=dhcp 26 | DEVICE=eth0 27 | ONBOOT=yes 28 | TYPE=Ethernet 29 | USERCTL=no 30 | ``` 31 | 32 | 33 | - Mẫu cloud-init. đối với ubuntu user mặc định sẽ là ubuntu, đối với CentosOS user mặc định sẽ là root 34 | ``` 35 | #cloud-config 36 | password: nautilus2020 37 | chpasswd: { expire: False } 38 | ssh_pwauth: True 39 | ``` 40 | 41 | 42 | ``` 43 | ## https://docs.openstack.org/image-guide/create-images-manually.html 44 | 45 | ``` -------------------------------------------------------------------------------- /Nova/6. Config-section.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Một số tùy chọn khác trong nova.conf 4 | 5 | 6 | ## 1. [Default] 7 | |Parameter = Value| Description| 8 | |------------------|-----------| 9 | |#password_length = 12| độ dài password tối thiểu của các tài khoản admin trong instance| 10 | |#compute_driver = | driver làm việc với các hypervisor | 11 | |#default_ephemeral_format = |cấu hình định dạng ổ đĩa trên local cho các instance| 12 | |#dhcp_lease_time = 86400| Thời gian lease cho DHCP 13 | |#dns_server =|Cấu hình DNS Server| 14 | | #metadata_host = $my_ip| Metadata Server | 15 | 16 | 17 | ## 2. [wsgi] 18 | |Parameter = Value| Description| 19 | |------------------|-----------| 20 | |#wsgi_log_format = %(client_ip)s "%(request_line)s" status: %(status_code)s len: %(body_length)s time: %(wall_seconds).7f| Format cho các API request | 21 | |#ssl_ca_file = | CA cho SSL| 22 | |#ssl_cert_file = | CE cho SSL | 23 | 24 | 25 | ## 3. [vnc] 26 | 27 | |Parameter = Value| Description| 28 | |------------------|-----------| 29 | |#enabled = true | Khởi động VNC | 30 | |#server_listen = 127.0.0.1 | IP trong instance sẽ nhận request VNC | 31 | 32 | ## 4. [key_manager] 33 | |Parameter = Value| Description| 34 | |------------------|-----------| 35 | |#fixed_key = | sử dụng secret key trong nova | 36 | |#backend = barbican | cấu hình backend cho fixed_key| 37 | |#auth_type = | Loại chứng chỉ xác thực để tạo| 38 | |#token = | token để xác thực | 39 | | | | 40 | -------------------------------------------------------------------------------- /Advance/2.RabbitMQ-&-API-Endpoint.md: -------------------------------------------------------------------------------- 1 | 2 | ## RabbitMQ và API trong Nova OPS 3 | 4 | 5 | ## 1. RabbitMQ và API 6 | 7 | - AMQP được chọn đảm nhiệm quản lý message trong Openstack Cloud . Rabbitmq sử dụng AMQP broker cho dịch vụ message queue của mình . Rabbitmq nắm nhiệm vụ ngồi giữa bất 2 compoment trong nova cho phép chúng liên lạc với nhau mà không cần xác thực. 8 | - Trong OPS tận dụng publish/subscribe để quản lý hàng chờ : 9 | ![](https://i.imgur.com/Y9ghikN.png) 10 | 11 | - Cung cấp khả năng tách biệt các message giữa nhiều _producer_ và _consumer_ 12 | - Đồng bộ toàn phần giữa producer và consumer. Trong rabbit mq cung cấp khả năng one-way messaging. Consumer gửi một request kèm theo một message . Client sẽ không chờ reply từ server mà vẫn sẽ tiếp tục xử lý . Request sẽ được gửi đến hàng chờ nơi producer sẽ message . Yêu cầu sẽ không được xử lý ngay lập tức nhưng vẫn sẽ ở trong hàng chờ cho đến khi message được gửi đến server . Khi message đã được chuyển vào hàng chờ thì , consumer sẽ không được nhận các thông báo về state bên prodcuer. 13 | 14 | - Trong khi đó khi một request được gửi đến API , các HTTP request gửi đến yêu cầu được reply từ server.. Giữa Client và Server cần thiết lập kết nối trước khi truyền tải . Đối với các Request API sẽ yêu cầu các service trả về response ngay lập tức, nhưng với rabbitmq sẽ được đưa vào hàng chờ cho đến khi producer thực hiện task theo một message , cung cấp khả năng chịu khi một compoment bị lỗi tại 1 thời điểm, không bị mất mát các tassk được yêu cầu từ API 15 | 16 | 17 | 18 | - Connection neutron-linux-bridge-agent từ compute node tớ controller node 19 | ![](https://i.imgur.com/IzVtmx4.png) 20 | -------------------------------------------------------------------------------- /7.Image/12. Redhat-8.md: -------------------------------------------------------------------------------- 1 | ## Cài đặt RHEL 8 2 | 3 | 4 | - Chọn ngôn ngữ cài đặt 5 | 6 | ![](https://i.imgur.com/Cn1FwLS.png) 7 | 8 | 9 | - Cấu hình một số thông số ban đầu 10 | ![](https://i.imgur.com/oOOJEOz.png) 11 | 12 | - Cấu hình Timezone 13 | ![](https://i.imgur.com/m09ZZ0R.png) 14 | 15 | - Cấu hình Disk Partion 16 | ![](https://i.imgur.com/5UFprDx.png) 17 | 18 | - Lựa chọn Edition Server để cài đặt 19 | ![](https://i.imgur.com/DvW5sk4.png) 20 | 21 | 22 | - Bắt đầu quá trình cài đặt 23 | ![](https://i.imgur.com/1J8uNpK.png) 24 | 25 | - Khởi tạo mật khẩu cho Root 26 | ![](https://i.imgur.com/3kxe1ke.png) 27 | 28 | 29 | ## Register RHEL 8 30 | 31 | 32 | https://www.redhat.com/en/resources/Linux-rhel-subscription-guide 33 | 34 | 35 | - Khởi tạo một phiên 36 | 37 | ``` 38 | # subscription-manager register --username nguyenhungsync --password hung19039! 39 | 40 | 41 | Registering to: subscription.rhsm.redhat.com:443/subscription 42 | 43 | The system has been registered with ID: d5e95ab2-b67f-4869-aa0e-a9aedfc269eb 44 | The registered system name is: localhost.localdomain 45 | Installed Product Current Status: 46 | Product Name: Red Hat Enterprise Linux for x86_64 47 | Status: Subscribed 48 | 49 | 50 | # subscription-manager role --set="Red Hat Enterprise Linux Server" 51 | # subscription-manager service-level --set="Self-Support" 52 | # subscription-manager usage --set="Development" 53 | # subscription-manager attach 54 | ``` 55 | 56 | - Kiểm tra subscription đang active 57 | ``` 58 | https://access.redhat.com/management/subscriptions?type=active 59 | ``` 60 | 61 | - Guide 62 | ``` 63 | https://access.redhat.com/products/red-hat-subscription-management 64 | ``` -------------------------------------------------------------------------------- /Advance/10. Limit-CPU-Resource.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### 1. Stress CPU và CGroup 4 | 5 | - Strees CPU trên máy ảo 6 | ``` 7 | yum install epel-release stress 8 | stress --cpu 1 --timeout 180 9 | ``` 10 | 11 | - Kiểm tra trên compute node. Process QEMU đang chiếm 100% của 1 CPU 12 | ![](https://i.imgur.com/a2u2pJm.png) 13 | 14 | - Cài đặt Cgroup trên Compute node 15 | ``` 16 | yum install install libcgroup libcgroup-tools 17 | systemctl start cgconfig 18 | systemctl enable cgconfig 19 | ``` 20 | 21 | - Cgroup sẽ quản lý các process theo các control group. Theo dạng phân cấp từ . ( root ) slice xuống các slice con, nhằm mục đích quản lý các process cùng một mục group process . 22 | - System Slice : quản lý các system service 23 | - Machine Slice : quản lý các virtual machie 24 | - User slice : quản lý các user session 25 | - Để xem cấu trúc phân cấp trong Cgroup : systemd-cgls 26 | 27 | - Cấu hình Cgroup limit %CPU của các service trong Machie Slice 28 | ``` 29 | systemctl set-property machine.slice CPUQuota=80% 30 | systemctl daemon-reload 31 | ``` 32 | 33 | - Stress máy ảo và kiểm tra lại trên Compute Node 34 | ![](https://i.imgur.com/BHy8brS.png) 35 | 36 | 37 | ### 2. Stress CPU và Flavor property 38 | 39 | - CPU period : chỉ định thời gian thực ( micro giây ) cho các process QEMU 40 | - CPU Quota : chỉ định băng thông tối đa trên mỗi `cpu-period` 41 | 42 | 43 | - Cấu hình flavor : giới hạn instance sử dụng 80% CPU vật lý 44 | ``` 45 | openstack flavor set ssd.small \ 46 | --property quota:cpu_quota=16000 \ 47 | --property quota:cpu_period=20000 48 | ``` 49 | 50 | 51 | - Stress trên máy ảo 52 | ![](https://i.imgur.com/cvNb6FH.png) 53 | 54 | - Kiểm tra trên Compute Node 55 | ![](https://i.imgur.com/94LQ0NQ.png) 56 | -------------------------------------------------------------------------------- /High-availability/3. Pacemaker/6. Pacemaker-Alert.md: -------------------------------------------------------------------------------- 1 | 2 | ## Tìm hiểu Pacemaker Alert 3 | 4 | 5 | ## 1. Alert Agent 6 | - Cluser sử dụng các chương trình ngoài để xử lý cảnh báo . Agent alert có thể sử dụng để làm việc với log, email, monitoring system . 7 | 8 | - Ví dụ về một agent. Agent này được gọi mỗi khi xuất hiện một sự kiện nào đó. 9 | ``` 10 | 11 | 12 | 13 | 14 | 15 | ``` 16 | 17 | - Các siêu thuộc tính có thể bổ sung vào alert 18 | - `timestamp-format` : xác định thời gian của một event 19 | - `timeout` : nếu agent không được xử lý thành công trong số thời gian nhất định sẽ bị bỏ qua. 20 | 21 | - Mặc định, các agent sẽ được gọi đến khi có node event, fencing, resource event. . Các agent có thể bỏ qua một số resource không quan tâm tới. 22 | ``` 23 | The possible options within `