oVirt Reports Portal 3.4 added to ovirt-engine

配置完oVirt engine后, 可以进行用户管理和虚拟化平台的管理, 但是无法生成报告.

如图, 点击Reports Portal会告诉你没有安装report application.

安装ovirt engine可参考昨天发的一篇文章.

http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/

engine report建议在engine配置前就安装, 那么只需engine-setup时可以直接配置.

现在的话, 等于已经配置了engine, 再加一个engine report的功能.

步骤如下 :

# yum install -y ovirt-engine-reports

Installing:
 ovirt-engine-reports                    noarch              3.4.3-1.el6                        ovirt-3.4-stable              1.1 M
Installing for dependencies:
 jasperreports-server                    noarch              5.5.0-7.el6                        ovirt-3.4-stable              423 M
 liberation-mono-fonts                   noarch              1.05.1.20090721-5.el6              C6.3-base                     222 k
 ovirt-engine-dwh-setup                  noarch              3.4.3-1.el6                        ovirt-3.4-stable               51 k
 ovirt-engine-reports-setup              noarch              3.4.3-1.el6                        ovirt-3.4-stable               54 k

安装时可能遇到GPGCHECK的问题, 加这个参数处理--nogpgcheck.

Package ovirt-engine-dwh-setup-3.4.3-1.el6.noarch.rpm is not signed

yum install --nogpgcheck -y ovirt-engine-reports

然后执行engine-setup配置.

[root@db-172-16-3-150 ~]# engine-setup --help
Usage: /usr/bin/engine-setup
    --log=file
        write log to this file.
    --config=file
        Load configuration files.
    --config-append=file
        Load extra configuration files or answer file.
    --offline
        Offline mode.
    --generate-answer=file
        Generate answer file.
    --jboss-home=dir
        Use this jboss.

使用engine-setup过程中, 需要调用pg_dump备份数据库, 这个命令会调用/usr/bin/pg_dump, 而且尝试了几种办法没有办法修改为其他路径下的pg_dump(因为备份和服务端的版本不匹配会导致pg_dump失败).  (见末尾)

所以使用了一个方法, 直接覆盖.

[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_dump /usr/bin
cp: overwrite `/usr/bin/pg_dump'? y
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_restore /usr/bin
cp: overwrite `/usr/bin/pg_restore'? y
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/psql /usr/bin
cp: overwrite `/usr/bin/psql'? y

还需要修改数据库用户的权限, 备份时开启了read only事务, 必须超级用户. 

2014-07-29 22:28:18 DEBUG otopi.plugins.**FILTERED**_engine_setup.**FILTERED**_engine.db.schema plugin.execute:866 execute-output: ('/usr/bin/pg_dump', '-E', 'UTF8', '--disable-dollar-quoting', '--disable-triggers', '--format=c', '-U', '**FILTERED**', '-h', 'localhost', '-p', '5432', '-f', '/var/lib/**FILTERED**-engine/backups/engine-20140729222818.Rbikl1.dump', '**FILTERED**') stderr:
pg_dump: [archiver (db)] query failed: ERROR:  permission denied to set parameter "transaction_read_only"
pg_dump: [archiver (db)] query was: SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY

修改为超级用户.

postgres=# alter role ovirt superuser;
ALTER ROLE

安装ovirt-report需要用到两个数据库, 一个历史库, 一个报告库.

需要新建. 用户使用ovirt同一个用户, 不一样也行, 无所谓.

# cd /ssd4/pg93
# mkdir tbs_ovirt_eh
# chown pg93:pg93 tbs_ovirt_eh

[root@db-172-16-3-150 pg93]# su - pg93
pg93@db-172-16-3-150-> psql
psql (9.3.3)
Type "help" for help.

digoal=# create tablespace tbs_ovirt_eh location '/ssd4/pg93/tbs_ovirt_eh';
CREATE TABLESPACE
digoal=# create database ovirt_eh with template template0 encoding 'UTF8' tablespace tbs_ovirt_eh owner ovirt;
CREATE DATABASE
digoal=# \c ovirt_eh ovirt
You are now connected to database "ovirt_eh" as user "ovirt".
-- ovirt_eh=> create schema ovirt;  -- 不推荐自建schema, 建议使用public. 和ovirt engine原因一样 .
-- CREATE SCHEMA

pg93@db-172-16-3-150-> mkdir /ssd4/pg93/tbs_ovirt_er
pg93@db-172-16-3-150-> psql
psql (9.3.3)
Type "help" for help.

digoal=# create tablespace tbs_ovirt_er location '/ssd4/pg93/tbs_ovirt_er';
CREATE TABLESPACE
digoal=# create database ovirt_er with template template0 encoding 'UTF8' tablespace tbs_ovirt_er owner ovirt;
CREATE DATABASE
digoal=# \c ovirt_er ovirt
You are now connected to database "ovirt_er" as user "ovirt".
-- ovirt_er=> create schema ovirt;   -- 不推荐自建schema, 建议使用public. 和ovirt engine原因一样 .
-- CREATE SCHEMA
ovirt_er=> \c postgres postgres
You are now connected to database "postgres" as user "postgres".
postgres=# grant all on tablespace tbs_ovirt_eh to ovirt;
GRANT
postgres=# grant all on tablespace tbs_ovirt_er to ovirt;
GRANT
postgres=# \q

现在还不能执行engine-setup, 务必改一下yum, 因为某些依赖包可能需要签名认证, 如果没有签名会导致认证失败.

不推荐这么做, 建议导入KEY.

http://blog.163.com/digoal@126/blog/static/1638770402014740018561/

关闭检测.

vi /etc/yum.repos.d/ovirt-3.4-dependencies.repo
vi /etc/yum.repos.d/ovirt-3.4.repo
修改所有的 gpgcheck=0.

可以执行engine-setup了, 执行过程中会重启ovirt-engine服务, 不过不会影响host上跑的虚拟机, 所以可以放心在线配置.

[root@db-172-16-3-150 ~]# engine-setup
[ INFO  ] Stage: Initializing
[ INFO  ] Stage: Environment setup
          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20140729223458-tzk701.log
          Version: otopi-1.2.2 (otopi-1.2.2-1.el6)
[ INFO  ] Stage: Environment packages setup
[ INFO  ] Yum Downloading: ovirt-3.4-epel/metalink (0%)
[ INFO  ] Yum Downloading: repomdydzDTUtmp.xml (0%)
[ INFO  ] Yum Downloading: repomd3tKhg7tmp.xml (0%)
[ INFO  ] Yum Downloading: repomdcWBV6Ttmp.xml (0%)
[ INFO  ] Stage: Programs detection
[ INFO  ] Stage: Environment setup
[ INFO  ] Stage: Environment customization

          --== PRODUCT OPTIONS ==--

          Configure Reports on this host (Yes, No) [Yes]:
          Configure Data Warehouse on this host (Yes, No) [Yes]: 

          --== PACKAGES ==--

[ INFO  ] Checking for product updates...
[ INFO  ] No product updates found

          --== NETWORK CONFIGURATION ==--

          Setup can automatically configure the firewall on this system.
          Note: automatic configuration of the firewall may overwrite current settings.
          Do you want Setup to configure the firewall? (Yes, No) [Yes]: No

          --== DATABASE CONFIGURATION ==--

          Where is the DWH database located? (Local, Remote) [Local]:
          Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
          Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: Manual

          ATTENTION

          Manual action required.
          Please create database for ovirt-engine use. Use the following commands as an example:

          create role ovirt_engine_history with login encrypted password 'ovirt_engine_history';
          create database ovirt_engine_history owner ovirt_engine_history
           template template0
           encoding 'UTF8' lc_collate 'en_US.UTF-8'
           lc_ctype 'en_US.UTF-8';

          Make sure that database can be accessed remotely.

          DWH database secured connection (Yes, No) [No]:
          DWH database name [ovirt_engine_history]: ovirt_eh
          DWH database user [ovirt_engine_history]: ovirt
          DWH database password:
          Where is the Reports database located? (Local, Remote) [Local]:
          Setup can configure the local postgresql server automatically for the Reports to run. This may conflict with existing applications.
          Would you like Setup to automatically configure postgresql and create Reports database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: Manual

          ATTENTION

          Manual action required.
          Please create database for ovirt-engine use. Use the following commands as an example:

          create role ovirt_engine_reports with login encrypted password 'ovirt_engine_reports';
          create database ovirt_engine_reports owner ovirt_engine_reports
           template template0
           encoding 'UTF8' lc_collate 'en_US.UTF-8'
           lc_ctype 'en_US.UTF-8';

          Make sure that database can be accessed remotely.

          Reports database secured connection (Yes, No) [No]:
          Reports database name [ovirt_engine_reports]: ovirt_er
          Reports database user [ovirt_engine_reports]: ovirt
          Reports database password: 

          --== OVIRT ENGINE CONFIGURATION ==--

          Skipping storing options as database already prepared

          --== PKI CONFIGURATION ==--

          PKI is already configured

          --== APACHE CONFIGURATION ==--

          --== SYSTEM CONFIGURATION ==--

          --== MISC CONFIGURATION ==--

          Reports power users password: 输入engien123
          Confirm Reports power users password: 输入engien123

          --== END OF CONFIGURATION ==--

[ INFO  ] Stage: Setup validation
[ INFO  ] Cleaning stale zombie tasks

          --== CONFIGURATION PREVIEW ==--

          Engine database name                    : ovirt
          Engine database secured connection      : False
          Engine database host                    : localhost
          Engine database user name               : ovirt
          Engine database host name validation    : False
          Engine database port                    : 5432
          Update Firewall                         : False
          Configure WebSocket Proxy               : False
          Host FQDN                               : db-172-16-3-150.sky-mobi.com
          NFS mount point                         : /ssd4/ovirt/iso
          DWH installation                        : True
          DWH database name                       : ovirt_eh
          DWH database secured connection         : False
          DWH database host                       : localhost
          DWH database user name                  : ovirt
          DWH database host name validation       : False
          DWH database port                       : 5432
          Configure local DWH database            : False
          Reports installation                    : True
          Reports database name                   : ovirt_er
          Reports database secured connection     : False
          Reports database host                   : localhost
          Reports database user name              : ovirt
          Reports database host name validation   : False
          Reports database port                   : 5432
          Configure local Reports database        : False

          Please confirm installation settings (OK, Cancel) [OK]:
[ INFO  ] Cleaning async tasks and compensations
[ INFO  ] Checking the Engine database consistency
[ INFO  ] Stage: Transaction setup
[ INFO  ] Stopping engine service
[ INFO  ] Stopping dwh service
[ INFO  ] Stopping websocket-proxy service
[ INFO  ] Stage: Misc configuration
[ INFO  ] Stage: Package installation
[ INFO  ] Stage: Misc configuration
[ INFO  ] Backing up database localhost:ovirt to '/var/lib/ovirt-engine/backups/engine-20140729223904.dQpGRz.dump'.
[ INFO  ] Updating Engine database schema
[ INFO  ] Creating/refreshing DWH database schema
[ INFO  ] Deploying Jasper
[ INFO  ] Importing data into Jasper
[ INFO  ] Configuring Jasper Java resources
[ INFO  ] Configuring Jasper Database resources
[ INFO  ] Customizing Jasper
[ INFO  ] Customizing Jasper metadata
[ INFO  ] Generating post install configuration file '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'
[ INFO  ] Stage: Transaction commit
[ INFO  ] Stage: Closing up

          --== SUMMARY ==--

          SSH fingerprint: 36:C7:7C:1F:6C:BA:8E:A1:C3:5E:30:1B:AB:07:CA:B7
          Internal CA 5D:77:8F:FF:12:7A:47:1A:20:D2:34:5E:83:8D:FB:7B:B3:78:68:55
          Web access is enabled at:
              http://db-172-16-3-150.sky-mobi.com:80/ovirt-engine
              https://db-172-16-3-150.sky-mobi.com:443/ovirt-engine
          In order to configure firewalld, copy the files from
              /etc/ovirt-engine/firewalld to /etc/firewalld/services
              and execute the following commands:
              firewall-cmd -service ovirt-postgres
              firewall-cmd -service ovirt-https
              firewall-cmd -service ovirt-http
          The following network ports should be opened:
              tcp:443
              tcp:5432
              tcp:80
          An example of the required configuration for iptables can be found at:
              /etc/ovirt-engine/iptables.example

          --== END OF SUMMARY ==--

[ INFO  ] Starting engine service
[ INFO  ] Restarting httpd
[ INFO  ] Starting dwh service
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20140729223458-tzk701.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20140729224557-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ INFO  ] Execution of setup completed successfully

配置完, 修改回普通用户.

postgres=# alter role ovirt nosuperuser;
ALTER ROLE

现在可以打开报告了, 从ovirt-engine或以下URL进入.

https://172.16.3.150/ovirt-engine-reports/


 

[其他]

1. pg_dump备份问题的几种解决办法, 都无效.

如果数据库使用了ovirt打包的依赖版本, 例如9.3.5, 那么请把这个版本的bin路径加到/etc/profile, 因为执行engine-setup的时候可能用到pg_dump , 版本不对可能导致备份失败.

vi /etc/profile
export PATH=/home/pg93/pgsql/bin:$PATH

退出shell重进, 确认pg_dump路径正确.

# which psql
/home/pg93/pgsql/bin/psql

或者执行engine-setup时设置PATH也行.

或者修改ovirt-engine 的 python脚本.

报错信息

[ INFO  ] Backing up database localhost:ovirt to '/var/lib/ovirt-engine/backups/engine-20140729213449.w8H6bH.dump'.
[ ERROR ] Failed to execute stage 'Misc configuration': Command '/usr/bin/pg_dump' failed to execute

日志中都报错信息, 说明了版本问题.

2014-07-29 21:34:49 DEBUG otopi.plugins.**FILTERED**_engine_setup.**FILTERED**_engine.db.schema plugin.execute:866 execute-output: (
'/usr/bin/pg_dump', '-E', 'UTF8', '--disable-dollar-quoting', '--disable-triggers', '--format=c', '-U', '**FILTERED**', '-h', 'local
host', '-p', '5432', '-f', '/var/lib/**FILTERED**-engine/backups/engine-20140729213449.w8H6bH.dump', '**FILTERED**') stderr:
pg_dump: server version: 9.3.3; pg_dump version: 8.4.20
pg_dump: aborting because of server version mismatch

修改ovirt-engine的python脚本, 还是没有效果.

/usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.py
	self._engineEnv.update({
            'PATH': (
                '/home/pg93/pgsql/bin:/usr/local/sbin:/usr/local/bin:'
                '/usr/sbin:/usr/bin:/sbin:/bin'
            ),

/usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py
        self._engineEnv = os.environ.copy()
        self._engineEnv.update({
            'PATH': (
                '/home/pg93/pgsql/bin:/usr/local/sbin:/usr/local/bin:'
                '/usr/sbin:/usr/bin:/sbin:/bin'
            ),

修改后, 日志依旧显示使用了/usr/bin/pg_dump

/var/log/ovirt-engine/setup/
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:468 ENVIRONMENT DUMP - BEGIN
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/chkconfig=str:'/sbin/chkconfig'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/date=str:'/bin/date'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/hwclock=str:'/sbin/hwclock'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/initctl=str:'/sbin/initctl'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/ip=str:'/sbin/ip'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/ntpq=str:'/usr/sbin/ntpq'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/pg_dump=str:'/usr/bin/pg_dump'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/pg_restore=str:'/usr/bin/pg_restore'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/psql=str:'/usr/bin/psql'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/reboot=str:'/sbin/reboot'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/restorecon=str:'/sbin/restorecon'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:478 ENV COMMAND/service=str:'/sbin/service'
2014-07-28 13:33:38 DEBUG otopi.context context.dumpEnvironment:482 ENVIRONMENT DUMP - END

最终选择了覆盖.

[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_dump /usr/bin
cp: overwrite `/usr/bin/pg_dump'? y
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/pg_restore /usr/bin
cp: overwrite `/usr/bin/pg_restore'? y
[root@db-172-16-3-150 ~]# cp /home/pg93/pgsql/bin/psql /usr/bin
cp: overwrite `/usr/bin/psql'? y

[参考]
1. http://wiki.ovirt.org/Ovirt_Reports

2. http://www.ovirt.org/How_to_setup_a_oVirt_Reports_development_environment

3. http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/

4. http://wiki.centos.org/HowTos/oVirt

时间: 2024-09-15 17:55:58

oVirt Reports Portal 3.4 added to ovirt-engine的相关文章

oVirt user portal Using Virtual Machines permission

前面都是在web admin下对虚拟机进行管理, 实际上, 一个虚拟化环境可能由多个客户在使用, 如何隔离客户之间的访问资源, 通过虚拟机的permission来管理, 为客户分配不同的用户, 将虚拟机的permission分配给不同的客户. 客户连接的是user portal , 不是web admin. 例如 https://172.16.3.176/ovirt-engine/userportal 管理 https://172.16.3.176/ovirt-engine/webadmin U

oVirt Architecture

[原文] http://www.ovirt.org/Architecture Architecture   Contents  [hide]  1 oVirt Architecture 1.1 Overall architecture 1.2 Engine 1.2.1 Engine-Core Architecture 1.3 Host Agent (VDSM) 1.3.1 Hooks mechanism 1.3.2 MOM integration 1.4 Web-based User Inter

oVirt engine 3.4 installed on CentOS 6.x x64

oVirt是RHEV的上游开源产品, 管理也和RHEV非常相似, 主打KVM的虚拟机管理平台. 相比OpenStack更加轻量化. 本文先介绍一下oVirt engine在CentOS 6.x x64平台下的安装. 除了数据库我们使用自己编译的PostgreSQL 9.3.5, 因为从依赖安装的版本实在太老了. 其他都使用依赖安装. 导入yum源 # wget http://resources.ovirt.org/pub/yum-repo/ovirt-release34.rpm # rpm -i

oVirt JBAS server start failed, ajp proxy cann't server correct. ovirt-engine URL cann't open

最后发现这个错误的根源是, 没有使用public schema .  所以建议不要自建和用户同名的schema. oVirt的管理web页无法打开, 使用代理到ajp://127.0.0.1:8702.  /etc/httpd/conf.d/z-ovirt-engine-proxy.conf     <LocationMatch ^/(ovirt-engine($|/)|api($|/)|RHEVManagerWeb/|OvirtEngineWeb/|ca.crt$|engine.ssh.key

oVirt host deploy

前面介绍了oVirt engine和report的部署, 参考 :  http://blog.163.com/digoal@126/blog/static/1638770402014628114756319/ http://blog.163.com/digoal@126/blog/static/163877040201462942137640/ 这里要介绍一下使用ovirt engine管理平台进行oVirt宿主机的部署. oVirt的架构介绍参考 :  http://www.ovirt.org

oVirt don&#039;t support OpenVSwitch now (2014-07-30)

oVirt Node Open vSwitch Integration Summary This feature will add support for Open vSwitch (and potentially Quantum/Neutron) to oVirt Node. Owner Name: Ryan Barry Email: rbarry AT redhat DOT com IRC: rbarry Current status Development 0% complete Link

介绍oVirt是如何组织与分配各种存储器的使用

oVirt(open Virtualization) 是一个基于 KVM(Kernel-based Virtual http://www.aliyun.com/zixun/aggregation/39569.html">Machine) 的开源 IaaS(Infrastructure as a Service) 项目,其前身是 Redhat 的桌面虚拟化商业产品.存储器的管理是 oVirt 的重点,本文将介绍 oVirt 是如何组织与分配各种存储器的,用户应该如何使用它. oVirt 的

SabreDAV v1.4.0 快速集成WebDAV系统

SabreDAV 可是使得你的Web应用程序很方便的集成 WebDAV 系统,支持大多数的客户端,包括 Mac OS X Finder, the Windows XP/Vista Explorer, DavFS2, Cadaver, NetDrive, and WebDrive. 支持 WebDAV 服务器 class 1, 2, 和 3. 实现了 RFC 2518 和 RFC 4918 的修订版,实现了 RFC 2617 认证. SabreDAV 1.4.0 is released. Vers

【故障处理】EXP-00003: no storage definition found for segment

EXP-00003: no storage definition found for segment EXP-3 No Storage Definition Found For Segment (文档 ID 443453.1) In this Document Symptoms Cause Solution APPLIES TO: Oracle Database - Enterprise Edition - Version 10.2.0.2 and laterInformation in thi