顯示具有 KVM 標籤的文章。 顯示所有文章
顯示具有 KVM 標籤的文章。 顯示所有文章

2018年10月9日 星期二

在 CentOS / RHEL 7 上,安裝 oVirt 4.2 服務

學習目標:
  • 在 CentOS / RHEL 7 Linux 作業系統上,安裝 oVirt 服務!
  • 使用三部主機進行安裝,一部安裝 ovirt-engine ,一部安裝 postgresql 資料庫,另一部為 Enterprise Linux Hosts!
  • 防火牆的部份,可以先關閉!利用硬體防火牆進行安全的防護即可!
oVirt Engine 安裝設定流程:
  1. 安裝相關必要軟體安裝工作!
    # yum -y upgrade
    # reboot
    
  2. 安裝 oVirt Engine 相關必要軟體:
    # yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
    # yum -y upgrade
    # reboot
    # yum -y install ovirt-engine
    
    PS:請先將資料庫安裝好!可參考本文 Database 安裝設定流程!
  3. 啟動 oVirt Engine 設定流程:
    # engine-setup
    (出現下列項目問題,請依實際狀況回答即可!)
    --== PRODUCT OPTIONS ==--
    Configure Engine on this host (Yes, No) [Yes]: 
    Configure ovirt-provider-ovn (Yes, No) [Yes]:
    Configure Image I/O Proxy on this host (Yes, No) [Yes]:
    Configure Data Warehouse on this host (Yes, No) [Yes]: 
    Configure VM Console Proxy on this host (Yes, No) [Yes]: 
    
    --== NETWORK CONFIGURATION ==--
    Host fully qualified DNS name of this server [ovirt42.hello.tw]:
    Do you want Setup to configure the firewall? (Yes, No) [Yes]:
    
    --== DATABASE CONFIGURATION ==--
    Where is the DWH database located? (Local, Remote) [Local]: Remote (因為需要使用外部資料庫,所以就選 Remote)
    Where is the Engine database located? (Local, Remote) [Local]: Remote
    DWH database host [localhost]: database.hello.tw
    DWH database port [5432]:
    DWH database secured connection (Yes, No) [No]:
    DWH database name [ovirt_engine_history]: ovirt
    DWH database user [ovirt_engine_history]: ovirt
    DWH database password:
    
    ATTENTION
    
    Manual action required.
    Please create database for ovirt-engine use.
    
    Engine database host [localhost]: database.hello.tw
    Engine database port [5432]: 
    Engine database secured connection (Yes, No) [No]:   
    Engine database name [engine]:
    
    --== OVIRT ENGINE CONFIGURATION ==--
             
    Engine admin password:
    Confirm engine admin password:
    Use default credentials (admin@internal) for ovirt-provider-ovn (Yes, No) [Yes]:
    
    --== STORAGE CONFIGURATION ==--
    Default SAN wipe after delete (Yes, No) [No]: 
    
    --== PKI CONFIGURATION ==--
    Organization name for certificate [tdhome.tw]:
    
    --== APACHE CONFIGURATION ==--
    Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]:
    Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:
    
    --== MISC CONFIGURATION ==--
    Please choose Data Warehouse sampling scale:
              (1) Basic
              (2) Full
              (1, 2)[1]: 2
    
    --== CONFIGURATION PREVIEW ==--
    Please confirm installation settings (OK, Cancel) [OK]:
    
  4. 注意最後的訊息!
    Please use the user 'admin@internal' and password specified in order to login
    Web access is enabled at:
        http://ovirt42.hello.tw:80/ovirt-engine
        https://ovirt42.hello.tw:443/ovirt-engine
    Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20181010114454-hs87tz.log
    Generating answer file '/var/lib/ovirt-engine/setup/answers/20181010115332-setup.conf'
    
  5. 由網頁登入後,即可加入主機節點,新增VM !!
Database 安裝設定流程:
  • 資料庫的部份,只能使用指定的 PostgreSQL 9.5.14 的版本!ovirt-release42 有提供!
  1. 安裝相關必要軟體安裝工作!
    # yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
    # yum -y upgrade
    # reboot
    
  2. 安裝與設定 PostgreSQL 9.5.14 資料庫相關軟體!
    # yum install rh-postgresql95-*
    # scl enable rh-postgresql95 -- postgresql-setup --initdb
    * Initializing database in '/var/opt/rh/rh-postgresql95/lib/pgsql/data'
    * Initialized, logs are in /var/lib/pgsql/initdb_rh-postgresql95-postgresql.log
    
  3. 啟動 PostgreSQL 資料庫!
    # systemctl enable rh-postgresql95-postgresql
    # systemctl start rh-postgresql95-postgresql
    
  4. 設定 PostgreSQL 資料庫 postgres 帳號與密碼!
    # su - postgres -c 'scl enable rh-postgresql95 -- psql'
    postgres=# ALTER USER postgres WITH PASSWORD 'abc123';
    postgres=# \q
    
  5. 設定 PostgreSQL 組態檔!
    # cd /var/opt/rh/rh-postgresql95/lib/pgsql/data/
    # vim postgresql.conf
    (只修改需要修改的部份)
    listen_addresses = '*'
    autovacuum_vacuum_scale_factor = 0.01
    autovacuum_analyze_scale_factor = 0.075
    autovacuum_max_workers = 6 
    work_mem = 8MB
    maintenance_work_mem = 64MB
    max_connections = 150
    
    # vim pg_hba.conf
    (追加在最後一行)
    host    all             all             192.168.100.0/24        md5
    
    # systemctl restart rh-postgresql95-postgresql
    
  6. 修改防火牆設定:
    # firewall-cmd --zone=public --add-service=postgresql
    # firewall-cmd --permanent --zone=public --add-service=postgresql
    
  7. 登入資料庫內,建立給 oVirt 專用的資料庫與帳號密碼
    # su - postgres -c 'scl enable rh-postgresql95 -- psql'
    postgres=# CREATE ROLE ovirt WITH LOGIN ENCRYPTED PASSWORD 'abc123';
    postgres=# CREATE DATABASE ovirt OWNER ovirt TEMPLATE template0 ENCODING 'UTF8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
    postgres=# \c ovirt;
    ovirt=# CREATE EXTENSION "uuid-ossp";
    ovirt=# CREATE LANGUAGE plpgsql;
    ovirt=# \q
    
  8. 重新啟動 PostgreSQL 資料庫與測試:
    # systemctl restart rh-postgresql95-postgresql
    
  9. 登入資料庫內,建立給 Engine 專用的資料庫與帳號密碼
    # su - postgres -c 'scl enable rh-postgresql95 -- psql'
    postgres=# CREATE ROLE engine WITH LOGIN ENCRYPTED PASSWORD 'abc123';
    postgres=# CREATE DATABASE engine OWNER engine TEMPLATE template0 ENCODING 'UTF8' LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
    postgres=# \c engine;
    engine=# CREATE EXTENSION "uuid-ossp";
    engine=# CREATE LANGUAGE plpgsql;
    engine=# \q
    
Enterprise Linux Hosts 安裝設定流程:
  1. 安裝相關必要軟體安裝工作!
    # yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
    # yum -y upgrade
    
  2. 安裝 Cockpit 軟體!
    # yum install cockpit-ovirt-dashboard
    
  3. 啟動 Cockpit 服務!
    # systemctl enable cockpit.socket
    # systemctl start cockpit.socket
    
  4. 利用 firefox 登入 https://localhost:9090 網頁
參考文獻:
  • https://ovirt.org/documentation/install-guide/Installation_Guide/

2017年8月24日 星期四

在 CentOS / RHEL 7 上架設 oVirt (RHEV-M) 服務

學習目標:
  • 安裝 oVirt 套件,以利管理虚擬機!
  • oVirt 套件,類似 RHEVM 管理套件,無授權使用問題!
操作流程:
  1. 安裝 oVirt 的 repository 套件:
    # yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm
    
  2. 安裝 dnf 的 相闗套件:
    # yum install dnf
    
  3. 安裝 oVirt 的套件:
    # dnf install -y ovirt-engine
    
  4. 安裝與設定 PostgreSQL 套件:
    # yum install postgresql postgresql-server postgresql-contrib
    # postgresql-setup initdb
    # vim /var/lib/pgsql/data/pg_hba.conf
    host    all             all             127.0.0.1/32            md5
    host    all             all             ::1/128                 md5
    
    # vim /var/lib/pgsql/data/postgresql.conf
    autovacuum_vacuum_scale_factor = 0.01  
    autovacuum_analyze_scale_factor = 0.075  
    autovacuum_max_workers = 6  
    maintenance_work_mem = 65536  
    max_connections = 150  
    lc_messages = 'en_US.UTF-8'
    
    # systemctl start postgresql
    # systemctl enable postgresql
    # firewall-cmd --permanent --add-service=postgresql
    # firewall-cmd --reload
    # psql -h 127.0.0.1 -U postgres -W
    postgres=# create database ovirt;
    
  5. 安裝設定 oVirt Engine :
    # engine-setup
    
  6. 按照出現的訊息,逐一安裝系統設定值 !
  7. 打開瀏覽器,連線到 oVirt 的管理網頁:
    # firefox https://www.example.com:443/ovirt-engine
    (登入的帳密 admin/你自己設定的密碼 )
    
  • http://www.ovirt.org/download/

2016年7月7日 星期四

KVM 教學文件


  1. https://jerry2yang.wordpress.com/2011/11/24/%E4%BF%AE%E6%94%B9%E8%99%9B%E6%93%AC%E6%A9%9Fkvmqemu%E7%A1%AC%E9%AB%94%E8%A8%AD%E5%AE%9A-with-virsh-management-user-interface/
  2. http://blog.changyy.org/2013/10/linux-virsh-snapshot-kvm-ubuntu-1204.html
  3. http://linuxkvm.blogspot.tw/2011/05/linux-kvm_15.html
  4. http://www.lijyyh.com/2015/12/linux-kvm-set-up-linux-kvm.html
  5. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/App_Domain_Monitor_Socket.html
  6. http://chimerhapsody.blogspot.tw/2013/03/kvm-kernel-based-virtual-machine.html

2016年5月28日 星期六

在 CentOS7/RHEL7 上使用 KVM 虚擬化技術

設定目標:
  • 在 Centos 7 上安裝 KVM 套件!
  • 利用 KVM,新增虚擬主機!
  • 架設一部 NFS Server 以及另一部 KVM 主機,活體移動虚擬主機!
    • 請參考這一篇的設定,架設好 Web Server!
快速設定流程:
  1. 利用 yum 安裝
    #yum install 
    

參考文獻:

  1. http://www.server-world.info/en/note?os=CentOS_7&p=kvm&f=1
  2. http://www.server-world.info/en/note?os=CentOS_7&p=kvm
  3. http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-kvm-qemu-on-centos-7-rhel-7.html

2015年12月31日 星期四

CentOS KVM 的使用

http://www.lijyyh.com/2015/12/linux-kvm-set-up-linux-kvm.html

2015年9月2日 星期三

Qcow2 轉成 physical disk

Qcow2 轉成 physical disk 的方式:

http://unix.stackexchange.com/questions/30106/move-qcow2-image-to-physical-hard-drive

http://askubuntu.com/questions/195139/how-to-convert-qcow2-virtual-disk-to-physical-machine-and-reversely

2015年8月28日 星期五

好用的 virsh

https://help.ubuntu.com/community/KVM/Virsh