IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    VMware:vCenter Server 6 + vCloud Director + Oracle

    Adamhuan发表于 2016-07-22 07:54:07
    love 0

    如题所示,本文将呈现搭建VMware vCenter Server与vCloud director的全部技术细节,在这个架构中,Oracle负责VMware元数据的存储。

    零、环境说明

    数据库服务器:
    Oracle database 11g。
    OS:CentOS 6.8。
    Hostname:oradb
    SID:vcenter
    Port:1521
    user for vCloud Director:vdirector
    user for vCenter Server:vserver
    password for account:Passw0rd

    vCenter Server:
    OS:MS Windows 2008 R2
    CPU:至少两颗
    内存:至少8G

    vCloud Director:
    OS:CentOS 6.8
    Hostname:vdirector
    网络:双网卡

    一、数据库服务器(Oracle)。

    [root@oradb ~]# hostname
    oradb
    [root@oradb ~]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:0C:29:B0:DD:92  
              inet addr:192.168.232.152  Bcast:192.168.232.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:feb0:dd92/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2696884 errors:0 dropped:0 overruns:0 frame:0
              TX packets:467369 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:2770375369 (2.5 GiB)  TX bytes:142389250 (135.7 MiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:272704 errors:0 dropped:0 overruns:0 frame:0
              TX packets:272704 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:72819292 (69.4 MiB)  TX bytes:72819292 (69.4 MiB)
    
    [root@oradb ~]# 
    [root@oradb ~]# su - oracle
    [oracle@oradb ~]$ id oracle
    uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)
    [oracle@oradb ~]$ 
    [oracle@oradb ~]$ ps -ef | grep pmon
    oracle    29697      1  0 05:45 ?        00:00:03 ora_pmon_vcenter
    oracle    33515  33484  0 11:57 pts/0    00:00:00 grep pmon
    [oracle@oradb ~]$ 
    [oracle@oradb ~]$ lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-JUL-2016 11:57:38
    
    Copyright (c) 1991, 2013, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
    Start Date                21-JUL-2016 05:39:55
    Uptime                    0 days 6 hr. 17 min. 43 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/oradb/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb)(PORT=1521)))
    Services Summary...
    Service "vcenter" has 1 instance(s).
      Instance "vcenter", status READY, has 1 handler(s) for this service...
    Service "vcenterXDB" has 1 instance(s).
      Instance "vcenter", status READY, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@oradb ~]$

    可以看到,实例【vcenter】已经启动,并被监听器监听在【1521】。

    为vCloud director创建单独的账户。

    创建单独的表空间:

    SQL> create tablespace vc_director_tbs_data datafile '/u01/app/oracle/oradata/vcenter/vc_director_tbs_data_01.dbf' size 1000M autoextend on;
    
    Tablespace created.
    
    SQL> create tablespace vc_director_tbs_indx datafile '/u01/app/oracle/oradata/vcenter/vc_director_tbs_indx_01.dbf' size 500M autoextend on;
    
    Tablespace created.
    
    SQL>

    创建单独的用户,并指定默认表空间为刚刚创建的表空间:

    SQL> create user vdirector identified by "Passw0rd" default tablespace vc_director_tbs_data;
    
    User created.
    
    SQL> 
    SQL> col username for a12
    SQL> col default_tablespace for a23
    SQL> select username,user_id,password,account_status,default_tablespace,temporary_tablespace from dba_users where account_status='OPEN' and username='VDIRECTOR';
    
    USERNAME        USER_ID PASSWORD                       ACCOUNT_STATUS          DEFAULT_TABLESPACE      TEMPORARY_TA
    ------------ ---------- ------------------------------ ----------------------- ----------------------- ------------
    VDIRECTOR            90                                OPEN                    VC_DIRECTOR_TBS_DATA    TEMP
    
    SQL>

    分配需要的权限或角色:

    SQL> grant connect,resource,create trigger,create type,create view,create materialized view,create procedure,create sequence,create table,unlimited tablespace to vdirector;
    
    Grant succeeded.
    
    SQL>

    官方文档这一块的描述是这样的:
    配置 Oracle 数据库

    将 Oracle 数据库与 vCloud Director 一起使用时Oracle 数据库具有特定的配置要求。安装 vCloud Director
    之前请安装并配置数据库实例并创建 vCloud Director 数据库用户帐户。
    步骤

    1配置数据库服务器。
    对于大多数 vCloud Director 群集来说配置一台内存为 16GB、存储容量为 100GB、且 CPU 为 4 个的数
    据库服务器便已足够。

    2创建数据库实例。
    使用以下形式的命令创建单独的数据 (CLOUD_DATA) 和索引 (CLOUD_INDX) 表空间
    Create Tablespace CLOUD_DATA datafile ‘$ORACLE_HOME/oradata/cloud_data01.dbf’ size 1000M
    autoextend on;
    Create Tablespace CLOUD_INDX datafile ‘$ORACLE_HOME/oradata/cloud_indx01.dbf’ size 500M
    autoextend on;

    3创建 vCloud Director 数据库用户帐户。
    以下命令将创建:
    数据库用户名:vcloud
    密码:vcloudpass

    Create user $vcloud identified by $vcloudpass default tablespace CLOUD_DATA;
    注意 创建 vCloud Director 数据库用户帐户时必须将 CLOUD_DATA 指定为默认的表空间。

    4配置数据库连接、进程和事务参数。
    必须对数据库进行配置使其至少允许每个 vCloud Director 单元中存在 75 个连接并且大约有 50 个连
    接供 Oracle 本身使用。您可以根据连接数量获取其他配置参数的值其中 C 表示 vCloud Director 群集中
    的单元数。
    Oracle 配置参数 C 单元的值
    CONNECTIONS 75*C+50
    PROCESSES = CONNECTIONS
    SESSIONS = PROCESSES*1.1+5
    TRANSACTIONS = SESSIONS*1.1
    OPEN_CURSORS = SESSIONS

    5创建 vCloud Director 数据库用户帐户。
    请勿将 Oracle 系统帐户用作 vCloud Director 数据库用户帐户。必须为此创建一个专用用户帐户。将以下
    系统特权授予此帐户
    CONNECT
    RESOURCE
    CREATE TRIGGER
    CREATE TYPE
    CREATE VIEW
    CREATE MATERIALIZED VIEW
    CREATE PROCEDURE
    CREATE SEQUENCE

    6记下数据库服务名称以便可以在配置网络和数据库连接时使用该名称。
    要查找数据库服务名称请在数据库服务器中打开文件
    $ORACLE_HOME/network/admin/tsnames.ora
    并查找以下形式的条目
    (SERVICE_NAME = orcl.example.com)

    为vCenter Server创建单独的账户。

    规则和要点与上面【vdirector】一样:

    SQL> create tablespace vc_server_tbs_data datafile '/u01/app/oracle/oradata/vcenter/vc_server_tbs_data01.dbf' size 1000m autoextend on;
    
    Tablespace created.
    
    SQL> create tablespace vc_server_tbs_indx datafile '/u01/app/oracle/oradata/vcenter/vc_server_tbs_indx01.dbf' size 500m autoextend on;
    
    Tablespace created.
    
    SQL> create user vserver identified by "Passw0rd" default tablespace vc_server_tbs_data;
    
    User created.
    
    SQL> grant connect,resource,create trigger,create type,create view,create materialized view,create procedure,create sequence,create table,unlimited tablespace to vserver;  
    
    Grant succeeded.
    
    SQL> 
    SQL> grant execute on dbms_job to vserver;
    
    Grant succeeded.
    
    SQL> grant execute on dbms_lock to vserver;
    
    Grant succeeded.
    
    SQL> grant select on dba_lock to vserver;
    
    Grant succeeded.
    
    SQL> grant select on v_$session to vserver;
    
    Grant succeeded.
    
    SQL>

    二、vCenter Server。

    操作系统。

    关闭防火墙:
    vcenter_server_os_1

    开放远程桌面:
    vcenter_server_os_2

    禁用IE ESC:
    vcenter_server_os_3

    修改主机名:–> AdamhuanVcs
    vcenter_server_os_4

    Windows PowerShell
    Copyright (C) 2009 Microsoft Corporation. All rights reserved.
    
    PS C:\Users\Administrator> hostname
    AdamhuanVcs
    PS C:\Users\Administrator>

    网卡:
    vcenter_server_os_5

    联网:

    PS C:\Users\Administrator> nslookup baidu.com
    Server:  public1.114dns.com
    Address:  114.114.114.114
    
    Non-authoritative answer:
    Name:    baidu.com
    Addresses:  111.13.101.208
              123.125.114.144
              220.181.57.217
              180.149.132.47
    
    PS C:\Users\Administrator>
    PS C:\Users\Administrator> ping -n 2 baidu.com
    
    Pinging baidu.com [220.181.57.217] with 32 bytes of data:
    Reply from 220.181.57.217: bytes=32 time=28ms TTL=128
    Reply from 220.181.57.217: bytes=32 time=31ms TTL=128
    
    Ping statistics for 220.181.57.217:
        Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 28ms, Maximum = 31ms, Average = 29ms
    PS C:\Users\Administrator>

    Oracle数据库客户端程序:
    oracle_client_1
    安装Oracle客户端程序。

    安装完成后,还需要一些配置:
    oracle_net_config_1

    oracle_net_config_2

    oracle_net_config_3

    oracle_net_config_4

    oracle_net_config_5

    oracle_net_config_6

    oracle_net_config_7

    oracle_net_config_8

    oracle_net_config_9

    oracle_net_config_10

    oracle_net_config_11

    查看下TNSNAMES文件的内容吧:

    PS C:\Users\Administrator> cd "C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN"
    PS C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN> ls
    
    
        Directory: C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN
    
    
    Mode                LastWriteTime     Length Name
    ----                -------------     ------ ----
    d----         7/22/2016  12:00 AM            SAMPLE
    -a---         7/22/2016  12:03 AM        263 sqlnet.ora
    -a---         7/22/2016  12:05 AM        263 sqlnet16072212AM0523.bak
    -a---         7/22/2016  12:10 AM        359 tnsnames.ora
    
    
    PS C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN> cat .\tnsnames.ora
    # tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    
    VCENTER =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.232.152)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = vcenter)
        )
      )
    
    PS C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN>
    PS C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN>

    测试下连通性:

    PS C:\app\Administrator\product\11.2.0\dbhome_1\bin> .\tnsping.exe vcenter
    
    TNS Ping Utility for 64-bit Windows: Version 11.2.0.3.0 - Production on 22-JUL-2016 00:12:23
    
    Copyright (c) 1997, 2011, Oracle.  All rights reserved.
    
    Used parameter files:
    C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.232.152)(PORT = 1521)))
    (CONNECT_DATA = (SERVICE_NAME = vcenter)))
    OK (0 msec)
    PS C:\app\Administrator\product\11.2.0\dbhome_1\bin>

    这样,Oracle数据库客户端的支持,就配置完成了。

    装载vCenter Server的安装介质(ISO):
    vCenter_Server_install_1

    vCenter_Server_install_2

    vCenter_Server_install_3

    vCenter Server 6.0:
    vmware_vcenter_Server_install_1

    vmware_vcenter_Server_install_2

    vmware_vcenter_Server_install_3

    vmware_vcenter_Server_install_4

    vmware_vcenter_Server_install_5

    vmware_vcenter_Server_install_6

    vmware_vcenter_Server_install_7

    vmware_vcenter_Server_install_8

    vmware_vcenter_Server_install_9
    这里选择外部数据库,但是可以看到,目前没有可选的外部数据库。

    ODBC:
    odbc_1

    odbc_2

    odbc_4
    注意这里的Oracle的ODBC支持,必须是前面安装了Oracle的客户端程序之后,才会出现的。

    odbc_3

    添加一个到目标Oracle的ODBC:
    odbc_1

    odbc_2

    odbc_3

    odbc_4

    odbc_5

    odbc_6

    odbc_7

    odbc_8

    odbc_9
    可以看到,ODBC添加到Oracle数据库的连接,测试成功,添加成功。

    注意:
    在ODBC中,添加DSN的时候是有所用范围的:User DSN与System DSN。
    对于vCenter Server的安装来说,只有System DSN,才可以被感知到。

    这时候,回到vCenter Server的安装画面,刷新(DSN,Data Source Name):
    vmware_vcenter_Server_install_10
    在继续下一步之前,我们先看看数据库中的情况:

    SQL> select owner,sum(bytes)/1024/1024 "MB" from dba_segments group by owner order by owner;
    
    OWNER                                  MB
    ------------------------------ ----------
    APEX_030200                       84.4375
    CTXSYS                              3.625
    DBSNMP                              .6875
    EXFSYS                              3.625
    HR                                 1.5625
    IX                                   1.75
    MDSYS                               74.25
    OE                                 9.0625
    OLAPSYS                            8.8125
    ORDDATA                           13.5625
    ORDSYS                              .4375
    
    OWNER                                  MB
    ------------------------------ ----------
    OUTLN                               .5625
    PM                                  12.25
    SCOTT                               .3125
    SH                               287.3125
    SYS                              870.0625
    SYSMAN                            69.1875
    SYSTEM                            30.8125
    VDIRECTOR                           8.625
    WMSYS                                 3.5
    XDB                               127.125
    
    21 rows selected.
    
    SQL> 
    SQL> select owner,sum(bytes)/1024/1024 "MB" from dba_segments where owner='VSERVER' group by owner order by owner;
    
    no rows selected
    
    SQL>

    回到vCenter Server的安装进程,开始执行:
    vmware_vcenter_Server_install_11
    这一步需要用你提供的账户操作数据库,所以,如果权限不够,就会如上报错。

    vmware_vcenter_Server_install_12

    vmware_vcenter_Server_install_13

    vmware_vcenter_Server_install_14

    vmware_vcenter_Server_install_15

    vmware_vcenter_Server_install_16

    vmware_vcenter_Server_install_17

    vmware_vcenter_Server_install_18
    可以看到,正在安装,这个过程会持续一段时间。

    vmware_vcenter_Server_install_19
    安装完成。

    访问网页查看:
    https://192.168.232.155
    账户:administrator@vsphere.local。(下面的截图,有部分的我并没有以正确的账户登录,这是需要注意的。如果参照本文档做,请使用正确的账户登录。)
    vsphere_client_1

    https://192.168.232.155/vsphere-client
    vsphere_client_2

    vsphere_client_3

    三、ESXi 6。

    详细的步骤,参考这篇文档:

    VMware ESXi 6:Install

    可以看到,在本次实验环境中:
    ESXi:192.168.232.154。

    四、创建数据中心(vCenter Server)

    查看一下:
    vcenter_server_first_1

    vcenter_server_first_2

    vcenter_server_first_3

    下面,做一个初步的配置:创建数据中心。
    vcenter_server_first_4

    vcenter_server_first_5

    vcenter_server_first_6

    vcenter_server_first_7
    这样,名为【AdamhuanDC】的数据中心,就创建完成了。

    查看数据中心状态:
    vcenter_server_first_8

    五、向数据中心添加ESXi主机

    将【192.168.232.154】的ESXi的主机加入数据中心【AdamhuanDC】:
    vcenterserver_addesxi_1

    vcenterserver_addesxi_2

    vcenterserver_addesxi_3

    vcenterserver_addesxi_4

    vcenterserver_addesxi_5

    vcenterserver_addesxi_6

    vcenterserver_addesxi_7

    vcenterserver_addesxi_8

    vcenterserver_addesxi_9

    vcenterserver_addesxi_10

    vcenterserver_addesxi_11
    这样就添加ESXi成功了。

    查看一下这台ESXi的状态:
    vcenterserver_addesxi_13

    添加成功后,就可以做一些操作了:
    vcenterserver_addesxi_12

    六、对vCenter Server的数据存储的配置
    向vCenter Server的存储中上传介质:
    vcenterserver_storage_1

    vcenterserver_storage_2

    vcenterserver_storage_3

    vcenterserver_storage_4

    vcenterserver_storage_5
    这样,上传介质到数据存储就完成了。

    添加一个新的数据存储:
    addstorage_1
    注意,这里增加磁盘空间,是在ESXi的主机(计算节点)上增加的,而不是vCenter Server(管理节点)。

    addstorage_2

    addstorage_3

    addstorage_4

    addstorage_5

    addstorage_6

    addstorage_7

    addstorage_8

    addstorage_9

    addstorage_10

    addstorage_11

    addstorage_12

    addstorage_13

    addstorage_14

    addstorage_15

    addstorage_16

    七、创建虚拟机

    通过vSphere Client在vCenter Server中创建虚拟机,存储在上面新创建的数据存储【vMachine】中。

    create_vMachine_1

    create_vMachine_2

    create_vMachine_3

    create_vMachine_4

    create_vMachine_5

    create_vMachine_6

    create_vMachine_7

    create_vMachine_8

    create_vMachine_9

    八、为【第七步】创建的虚拟机装操作系统

    分配安装介质(ISO):
    vcenterserver_os_1

    vcenterserver_os_2

    开始安装:
    vcenterserver_os_3

    vcenterserver_os_4

    vcenterserver_os_5
    正在安装,等待一段时间即可。
    (这里,具体的Linux的安装过程我省略了,这一部分不是太难,而且都是常见的安装选项,并且Linux的安装也不是本文的重点。如果一定需要知道详情,可以去检索本站往期的日志,应该有需要的答案。)

    安装完成:
    vcenterserver_os_6

    九、vCloud director。

    用上面【第八步】创建的虚拟机,搭建vCloud Director。

    服务器的基本情况:

    [root@vdirector ~]# hostname
    vdirector
    [root@vdirector ~]# 
    [root@vdirector ~]# ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:50:56:A6:12:4B  
              inet addr:192.168.232.157  Bcast:192.168.232.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fea6:124b/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:102 errors:0 dropped:0 overruns:0 frame:0
              TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:20048 (19.5 KiB)  TX bytes:10581 (10.3 KiB)
    
    eth1      Link encap:Ethernet  HWaddr 00:50:56:A6:46:2F  
              inet addr:192.168.232.158  Bcast:192.168.232.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fea6:462f/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:31 errors:0 dropped:0 overruns:0 frame:0
              TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:3163 (3.0 KiB)  TX bytes:3054 (2.9 KiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:60 errors:0 dropped:0 overruns:0 frame:0
              TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:4028 (3.9 KiB)  TX bytes:4028 (3.9 KiB)
    
    [root@vdirector ~]# 
    [root@vdirector etc]# cat /etc/hosts
    # Local
    127.0.0.1       localhost
    127.0.0.1       vdirector
    
    # Pub
    #192.168.232.157        vdirector
    [root@vdirector etc]# 
    [root@vdirector etc]#

    注意,/etc/hosts一定要如上配置,否则会在后面启动服务的时候出错:
    vcloud_director_error_1

    创建数字证书:

    [root@vdirector ~]# mkdir /opt/keystore
    [root@vdirector ~]# cd /opt/keystore/
    [root@vdirector keystore]# ls -ltr
    total 0
    [root@vdirector keystore]# keytool -keystore vdirectorcert.ks -storetype JCEKS -storepass Passw0rd -genkey -keyalg RSA -alias http
    What is your first and last name?
      [Unknown]:  Adamhuan
    What is the name of your organizational unit?
      [Unknown]:  Engineering
    What is the name of your organization?
      [Unknown]:  Example
    What is the name of your City or Locality?
      [Unknown]:  PuDong
    What is the name of your State or Province?
      [Unknown]:  Shanghai
    What is the two-letter country code for this unit?
      [Unknown]:  CN
    Is CN=Adamhuan, OU=Engineering, O=Example, L=PuDong, ST=Shanghai, C=CN correct?
      [no]:  yes
    
    Enter key password for 
            (RETURN if same as keystore password):  
    [root@vdirector keystore]# 
    [root@vdirector keystore]# keytool -storetype JCEKS -storepass Passw0rd -keystore vdirectorcert.ks -list
    
    Keystore type: JCEKS
    Keystore provider: SunJCE
    
    Your keystore contains 1 entry
    
    http, Jul 21, 2016, PrivateKeyEntry, 
    Certificate fingerprint (SHA1): 35:AF:F5:41:0B:EC:5D:AE:EE:4C:67:F2:7D:6C:69:4B:55:85:89:11
    [root@vdirector keystore]# 
    [root@vdirector keystore]# keytool -keystore vdirectorcert.ks -storetype JCEKS -storepass Passw0rd -certreq -alias http -file http.csr
    [root@vdirector keystore]# keytool -keystore vdirectorcert.ks -storetype JCEKS -storepass Passw0rd -genkey -keyalg RSA -alias consoleproxy
    What is your first and last name?
      [Unknown]:  192.168.232.158
    What is the name of your organizational unit?
      [Unknown]:  
    What is the name of your organization?
      [Unknown]:  
    What is the name of your City or Locality?
      [Unknown]:  
    What is the name of your State or Province?
      [Unknown]:  
    What is the two-letter country code for this unit?
      [Unknown]:  
    Is CN=192.168.232.158, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
      [no]:  yes
    
    Enter key password for 
            (RETURN if same as keystore password):  
    [root@vdirector keystore]# 
    [root@vdirector keystore]# keytool -storetype JCEKS -storepass Passw0rd -keystore vdirectorcert.ks -list
    
    Keystore type: JCEKS
    Keystore provider: SunJCE
    
    Your keystore contains 2 entries
    
    consoleproxy, Jul 21, 2016, PrivateKeyEntry, 
    Certificate fingerprint (SHA1): 62:2E:5F:5B:D5:45:4F:2F:D9:81:88:6C:48:D6:73:9E:00:D9:A9:52
    http, Jul 21, 2016, PrivateKeyEntry, 
    Certificate fingerprint (SHA1): 35:AF:F5:41:0B:EC:5D:AE:EE:4C:67:F2:7D:6C:69:4B:55:85:89:11
    [root@vdirector keystore]# 
    [root@vdirector keystore]# keytool -keystore vdirectorcert.ks -storetype JCEKS -storepass Passw0rd -certreq -alias consoleproxy -file consoleproxy.csr
    [root@vdirector keystore]# 
    [root@vdirector keystore]# ls -ltr *
    -rw-r--r--. 1 root root 1079 Jul 21 20:55 http.csr
    -rw-r--r--. 1 root root 4432 Jul 21 20:55 vdirectorcert.ks
    -rw-r--r--. 1 root root 1092 Jul 21 20:56 consoleproxy.csr
    [root@vdirector keystore]#

    安装RPM包:redhat-lsb
    Command:yum install -y redhat-lsb

    如果已经安装:

    [root@vdirector keystore]# rpm -qa | grep --color redhat-lsb
    redhat-lsb-printing-4.0-7.el6.centos.x86_64
    redhat-lsb-compat-4.0-7.el6.centos.x86_64
    redhat-lsb-core-4.0-7.el6.centos.x86_64
    redhat-lsb-4.0-7.el6.centos.x86_64
    redhat-lsb-graphics-4.0-7.el6.centos.x86_64
    [root@vdirector keystore]#

    安装和配置vCloud Director软件:
    安装前:

    [root@vdirector keystore]# rpm -qa | grep --color vmware
    xorg-x11-drv-vmware-13.1.0-2.el6.x86_64
    [root@vdirector keystore]# 
    [root@vdirector keystore]# tail -n 2 /etc/passwd
    sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
    tcpdump:x:72:72::/:/sbin/nologin
    [root@vdirector keystore]#

    上传服务器,并执行安装:
    上传:

    [root@vdirector ~]# cd /software
    [root@vdirector software]# ls -ltr *
    -rw-r--r-- 1 root root 211106732 Jul 21 00:35 vmware-vcloud-director-distribution-8.10.0-3880025.bin
    [root@vdirector software]# du -sh *
    202M    vmware-vcloud-director-distribution-8.10.0-3880025.bin
    [root@vdirector software]#

    安装:

    [root@vdirector software]# chmod -R 777 vmware-vcloud-director-distribution-8.10.0-3880025.bin 
    [root@vdirector software]# 
    [root@vdirector software]# ./vmware-vcloud-director-distribution-8.10.0-3880025.bin 
    Checking free disk space...done
    Checking for a supported Linux distribution...Detected CentOS system
    done
    Checking for necessary RPM prerequisites...done
    Extracting VMware vCloud Director. Please wait, this could take a few minutes...
    vmware-vcloud-director-8.10.0-3879706.x86_64.rpm
    vmware-vcloud-director-rhel-8.10.0-3879706.x86_64.rpm
    vmware-phonehome-1.0.0-3813496.noarch.rpm
    done
    Verifying RPM signatures...done
    Installing the VMware vCloud Director RPMs...
    warning: vmware-vcloud-director-8.10.0-3879706.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 66fd4949: NOKEY
    Preparing...                ########################################### [100%]
       1:vmware-vcloud-director-########################################### [ 33%]
    
    NOTE: This system has less memory installed than the recommended amount
    
    Required: 2.0 GB; Recommended: 5.0 GB
    
    VMware recommends at least 5.0 GB of memory be available for vCloud Director
    to operate. You may notice degraded performance with less.  It is recommended
    that you increase the available memory prior to starting the  service.
    
       2:vmware-vcloud-director ########################################### [ 67%]
       3:vmware-phonehome       ########################################### [100%]
    
    You should now run the configuration script
    (/opt/vmware/vcloud-director/bin/configure) to perform other required
    post-installation configuration.
    
    If you will be deploying a vCloud Director cluster you must mount the shared
    transfer server storage prior to running the configuration script. If this
    is a single server deployment no shared storage is necessary.
    
    If you are not ready to do this right now, you may run the script later
    prior to starting the vmware-vcd service.
    
    Would you like to run the script now? (y/n)? y

    安装到这里,安装程序还没有执行完,但是安装已经结束了。
    如果你希望现在就开始执行配置脚本,你可以像上面一样选择【y】。

    执行脚本:

    Would you like to run the script now? (y/n)? y
    Welcome to the vCloud Director configuration utility.
    
    You will be prompted to enter a number of parameters that are necessary to
    configure and start the vCloud Director service.
    
    Please indicate which IP address available on this machine should be used for
    the HTTP service and which IP address should be used for the remote console proxy.
    
    The HTTP service IP address is used for accessing the user interface and the
    REST API. The remote console proxy IP address is used for all remote console
    connections and traffic.
    
    Please enter your choice for the HTTP service IP address:
            1. 192.168.232.157
            2. 192.168.232.158
            3. 127.0.0.1
            4. [fe80:0:0:0:250:56ff:fea6:124b%eth0]
            5. [fe80:0:0:0:250:56ff:fea6:462f%eth1]
            6. [0:0:0:0:0:0:0:1%lo]
    Choice [default=1]: 1
    
    Please enter your choice for the remote console proxy IP address:
            1. 192.168.232.158
            2. 127.0.0.1
            3. [fe80:0:0:0:250:56ff:fea6:124b%eth0]
            4. [fe80:0:0:0:250:56ff:fea6:462f%eth1]
            5. [0:0:0:0:0:0:0:1%lo]
    Choice [default=1]: 1
    
    Please enter the path to the Java keystore containing your SSL certificates and
    private keys: /opt/keystore/vdirectorcert.ks
    Please enter the password for the keystore: 
    
    If you would like to enable remote audit logging to a syslog host please enter
    the hostname or IP address of the syslog server. Audit logs are stored by
    vCloud Director for 90 days. Exporting logs via syslog will enable you to
    preserve them for as long as necessary.
    
    Syslog host name or IP address [press Enter to skip]:  
    No syslog host was specified, disabling remote audit logging.
    
    The following database types are supported:
            1. Oracle
            2. Microsoft SQL Server
    Enter the database type [default=1]:

    脚本执行到这里,开始选择数据库。
    在我的环境中,我的数据库是Oracle,所以,我应该选择【1】。

    在正式操作前,我们先看看数据库的数据状态:

    SQL> select owner,sum(bytes)/1024/1024 "MB" from dba_segments group by owner order by owner;
    
    OWNER                                  MB
    ------------------------------ ----------
    APEX_030200                       84.4375
    CTXSYS                              3.625
    DBSNMP                              .6875
    EXFSYS                              3.625
    HR                                 1.5625
    IX                                   1.75
    MDSYS                               74.25
    OE                                 9.0625
    OLAPSYS                            8.8125
    ORDDATA                           13.5625
    ORDSYS                              .4375
    
    OWNER                                  MB
    ------------------------------ ----------
    OUTLN                               .5625
    PM                                  12.25
    SCOTT                               .3125
    SH                               287.3125
    SYS                                866.75
    SYSMAN                                 69
    SYSTEM                            30.8125
    WMSYS                                 3.5
    XDB                               127.125
    
    20 rows selected.
    
    SQL>

    数据库的运行状态:

    [oracle@oradb ~]$ lsnrctl status
    
    LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-JUL-2016 13:01:33
    
    Copyright (c) 1991, 2013, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
    Start Date                21-JUL-2016 05:39:55
    Uptime                    0 days 7 hr. 21 min. 38 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/oradb/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradb)(PORT=1521)))
    Services Summary...
    Service "vcenter" has 1 instance(s).
      Instance "vcenter", status READY, has 1 handler(s) for this service...
    Service "vcenterXDB" has 1 instance(s).
      Instance "vcenter", status READY, has 1 handler(s) for this service...
    The command completed successfully
    [oracle@oradb ~]$ 
    [oracle@oradb ~]$ tnsping vcenter
    
    TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 21-JUL-2016 13:01:38
    
    Copyright (c) 1997, 2013, Oracle.  All rights reserved.
    
    Used parameter files:
    /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
    
    
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oradb)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = vcenter)))
    OK (0 msec)
    [oracle@oradb ~]$

    回到vCloud Director的脚本执行:

    The following database types are supported:
            1. Oracle
            2. Microsoft SQL Server
    Enter the database type [default=1]: 1
    Enter the host (or IP address) for the database: 192.168.232.152
    Enter the database port [default=1521]: 1521
    Enter the database service name [default=orcl]: vcenter
    Enter the database username: vdirector
    Enter the database password: 
    Connecting to the database: jdbc:oracle:thin:@192.168.232.152:1521/vcenter
    ......................................../

    如果数据库连接没有问题,脚本就会通过JDBC往数据库中写数据。

    最终,这一步完成后,数据库的状态是这样的:

    SQL> select owner,sum(bytes)/1024/1024 "MB" from dba_segments group by owner order by owner;
    
    OWNER                                  MB
    ------------------------------ ----------
    APEX_030200                       84.4375
    CTXSYS                              3.625
    DBSNMP                              .6875
    EXFSYS                              3.625
    HR                                 1.5625
    IX                                   1.75
    MDSYS                               74.25
    OE                                 9.0625
    OLAPSYS                            8.8125
    ORDDATA                           13.5625
    ORDSYS                              .4375
    
    OWNER                                  MB
    ------------------------------ ----------
    OUTLN                               .5625
    PM                                  12.25
    SCOTT                               .3125
    SH                               287.3125
    SYS                                870.25
    SYSMAN                            69.0625
    SYSTEM                            30.8125
    VDIRECTOR                          8.5625
    WMSYS                                 3.5
    XDB                               127.125
    
    21 rows selected.
    
    SQL> select owner,sum(bytes)/1024/1024 "MB" from dba_segments where owner='VDIRECTOR' group by owner order by owner;
    
    OWNER                                  MB
    ------------------------------ ----------
    VDIRECTOR                          8.5625
    
    SQL>

    继续执行脚本:

    The following database types are supported:
            1. Oracle
            2. Microsoft SQL Server
    Enter the database type [default=1]: 1
    Enter the host (or IP address) for the database: 192.168.232.152
    Enter the database port [default=1521]: 1521
    Enter the database service name [default=orcl]: vcenter
    Enter the database username: vdirector
    Enter the database password: 
    Connecting to the database: jdbc:oracle:thin:@192.168.232.152:1521/vcenter
    ......................................../
    VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As part of the CEIP, VMware collects technical information about your organization's use of VMware products and services on a regular basis in association with your organization's VMware license key(s). This information does not personally identify any individual. 
    Additional information regarding the data collected through CEIP and the purposes for which it is used by VMware is set forth in the Trust & Assurance Center at http://www.vmware.com/trustvmware/ceip.html. If you prefer not to participate in VMware's CEIP for this product, you should enter "n" below. 
    You may join or leave VMware's CEIP for this product at any time.
    
    Join the VMware Customer Experience Improvement Program [y/n]: y
    Database configuration complete.
    
    vCloud Director configuration is now complete.
    
    Once the vCloud Director server has been started you will be able to
    access the first-time setup wizard at this URL:
            https://192.168.232.157
    
    Would you like to start the vCloud Director service now? If you choose not
    to start it now, you can manually start it at any time using this command:
    service vmware-vcd start
    
    Start it now? [y/n] y
    
    Starting vmware-vcd-watchdog: [  OK  ]
    Starting vmware-vcd-cell[  OK  ]
    
    The vCD service will be started automatically on boot.  To disable this,
    use the following command: chkconfig --del vmware-vcd
    
    [root@vdirector software]#

    最后,问问你要不要加入VMware的增强体验计划,然后问你要不要现在就启动vCloud Director服务。

    这样,vCloud Director的安装就结束了。

    上面的过程中,因为要说明,所以把命令反馈拆解了。
    这个过程中的命令反馈的完整版本如下:

    [root@vdirector software]# ./vmware-vcloud-director-distribution-8.10.0-3880025.bin 
    Checking free disk space...done
    Checking for a supported Linux distribution...Detected CentOS system
    done
    Checking for necessary RPM prerequisites...done
    Extracting VMware vCloud Director. Please wait, this could take a few minutes...
    vmware-vcloud-director-8.10.0-3879706.x86_64.rpm
    vmware-vcloud-director-rhel-8.10.0-3879706.x86_64.rpm
    vmware-phonehome-1.0.0-3813496.noarch.rpm
    done
    Verifying RPM signatures...done
    Installing the VMware vCloud Director RPMs...
    warning: vmware-vcloud-director-8.10.0-3879706.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 66fd4949: NOKEY
    Preparing...                ########################################### [100%]
       1:vmware-vcloud-director-########################################### [ 33%]
    
    NOTE: This system has less memory installed than the recommended amount
    
    Required: 2.0 GB; Recommended: 5.0 GB
    
    VMware recommends at least 5.0 GB of memory be available for vCloud Director
    to operate. You may notice degraded performance with less.  It is recommended
    that you increase the available memory prior to starting the  service.
    
       2:vmware-vcloud-director ########################################### [ 67%]
       3:vmware-phonehome       ########################################### [100%]
    
    You should now run the configuration script
    (/opt/vmware/vcloud-director/bin/configure) to perform other required
    post-installation configuration.
    
    If you will be deploying a vCloud Director cluster you must mount the shared
    transfer server storage prior to running the configuration script. If this
    is a single server deployment no shared storage is necessary.
    
    If you are not ready to do this right now, you may run the script later
    prior to starting the vmware-vcd service.
    
    Would you like to run the script now? (y/n)? y
    Welcome to the vCloud Director configuration utility.
    
    You will be prompted to enter a number of parameters that are necessary to
    configure and start the vCloud Director service.
    
    Please indicate which IP address available on this machine should be used for
    the HTTP service and which IP address should be used for the remote console proxy.
    
    The HTTP service IP address is used for accessing the user interface and the
    REST API. The remote console proxy IP address is used for all remote console
    connections and traffic.
    
    Please enter your choice for the HTTP service IP address:
            1. 192.168.232.157
            2. 192.168.232.158
            3. 127.0.0.1
            4. [fe80:0:0:0:250:56ff:fea6:124b%eth0]
            5. [fe80:0:0:0:250:56ff:fea6:462f%eth1]
            6. [0:0:0:0:0:0:0:1%lo]
    Choice [default=1]: 1
    
    Please enter your choice for the remote console proxy IP address:
            1. 192.168.232.158
            2. 127.0.0.1
            3. [fe80:0:0:0:250:56ff:fea6:124b%eth0]
            4. [fe80:0:0:0:250:56ff:fea6:462f%eth1]
            5. [0:0:0:0:0:0:0:1%lo]
    Choice [default=1]: 1
    
    Please enter the path to the Java keystore containing your SSL certificates and
    private keys: /opt/keystore/vdirectorcert.ks
    Please enter the password for the keystore: 
    
    If you would like to enable remote audit logging to a syslog host please enter
    the hostname or IP address of the syslog server. Audit logs are stored by
    vCloud Director for 90 days. Exporting logs via syslog will enable you to
    preserve them for as long as necessary.
    
    Syslog host name or IP address [press Enter to skip]: 
    No syslog host was specified, disabling remote audit logging.
    
    The following database types are supported:
            1. Oracle
            2. Microsoft SQL Server
    Enter the database type [default=1]: 1
    Enter the host (or IP address) for the database: 192.168.232.152
    Enter the database port [default=1521]: 
    Using default value "1521" for port.
    
    Enter the database service name [default=orcl]: vcenter
    Enter the database username: vdirector
    Enter the database password: 
    Connecting to the database: jdbc:oracle:thin:@192.168.232.152:1521/vcenter
    ......................................../
    VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As part of the CEIP, VMware collects technical information about your organization's use of VMware products and services on a regular basis in association with your organization's VMware license key(s). This information does not personally identify any individual. 
    Additional information regarding the data collected through CEIP and the purposes for which it is used by VMware is set forth in the Trust & Assurance Center at http://www.vmware.com/trustvmware/ceip.html. If you prefer not to participate in VMware's CEIP for this product, you should enter "n" below. 
    You may join or leave VMware's CEIP for this product at any time.
    
    Join the VMware Customer Experience Improvement Program [y/n]: y
    Database configuration complete.
    
    vCloud Director configuration is now complete.
    
    Once the vCloud Director server has been started you will be able to
    access the first-time setup wizard at this URL:
            https://192.168.232.157
    
    Would you like to start the vCloud Director service now? If you choose not
    to start it now, you can manually start it at any time using this command:
    service vmware-vcd start
    
    Start it now? [y/n] y
    
    Starting vmware-vcd-watchdog: [  OK  ]
    Starting vmware-vcd-cell[  OK  ]
    
    The vCD service will be started automatically on boot.  To disable this,
    use the following command: chkconfig --del vmware-vcd
    
    [root@vdirector software]#

    其实,在安装过程中,当前目录也是有所变化的:

    [root@vdirector software]# ls -ltr *
    -rw-r--r-- 1  201  201 191933311 May 13 11:32 vmware-vcloud-director-8.10.0-3879706.x86_64.rpm
    -rw-r--r-- 1  201  201      2270 May 13 11:32 vmware-vcloud-director-rhel-8.10.0-3879706.x86_64.rpm
    -rw-r--r-- 1  201  201  19120557 May 13 13:02 vmware-phonehome-1.0.0-3813496.noarch.rpm
    -rw-r--r-- 1  201  201        75 May 13 13:02 extra.list
    -rwxrwxrwx 1 root root 211106732 Jul 21 00:35 vmware-vcloud-director-distribution-8.10.0-3880025.bin
    -rw-r--r-- 1 root root 211066880 Jul 22 03:55 VMware vCloud Director.tar
    [root@vdirector software]# 
    [root@vdirector software]# du -sh *
    4.0K    extra.list
    19M     vmware-phonehome-1.0.0-3813496.noarch.rpm
    184M    vmware-vcloud-director-8.10.0-3879706.x86_64.rpm
    202M    vmware-vcloud-director-distribution-8.10.0-3880025.bin
    4.0K    vmware-vcloud-director-rhel-8.10.0-3879706.x86_64.rpm
    202M    VMware vCloud Director.tar
    [root@vdirector software]# 
    [root@vdirector software]# cat extra.list 
    vmware-phonehome-1.0.0-3813496.noarch.rpm;618fdf940a6a462620fc3111a83a4bd0
    [root@vdirector software]#

    前面,安装结束后,反馈了这样的信息:
    Once the vCloud Director server has been started you will be able to
    access the first-time setup wizard at this URL:
    https://192.168.232.157

    让我们浏览下这个网址【https://192.168.232.157】:
    vcloud_director_web_1

    vcloud_director_web_2

    vcloud_director_web_3
    可以看到,需要许可Licence,才可以进行下一步配置。

    (这里,我暂时没有许可密钥,… 玩不下去了。)

    总之,… 整个VMware的vCloud Director与vCenter Server的配置大概就是上面说的这样了。
    ————————————
    Done。



沪ICP备19023445号-2号
友情链接