Focus On Oracle

Installing, Backup & Recovery, Performance Tuning,
Troubleshooting, Upgrading, Patching

Oracle Engineered System


当前位置: 首页 » 技术文章 » Cloud

通过ODA虚拟化构建私有云平台

ODA虚拟化架构

ODA中的虚拟化是基于ACFS文件系统的,底层是通过在ASM中创建DiskGroup,然后创建ACFS文件系统,然后通过NFS的方式再挂到Dom0的OS上,这种高可用性是基于ORACLE集群软件的,虚拟化可以在其中任何一个节点上运行,如果出现问题可以迁移到另外的一个节点,ASM磁盘组也采用了冗余,在很大程度上也保证数据的稳定和可靠,在易用性方面也不错,提供了很多模板(数据库、中间件等等),能在短时间内部署,方便快捷,当然在成本方面也会下降不少。下图为架构图

[root@x5odadb0 ~]# oakcli show repo
  NAME                     TYPE      NODENUM FREE SPACESTATE     SIZE
  odarepo1                 local     0              N/AN/A       N/A
  odarepo2                 local     1              N/AN/A       N/A
  repo_cj                  shared    0           80.26%ONLINE    1253376.0M
  repo_cj                  shared    1           80.26%ONLINE    1253376.0M
  repo_cjjs                shared    0           79.80%ONLINE    1253376.0M
  repo_cjjs                shared    1           79.80%ONLINE    1253376.0M
  repo_psdyy               shared    0           14.41%ONLINE    1970176.0M
  repo_psdyy               shared    1           14.41%ONLINE    1970176.0M  
  repo_wsyyt               shared    0           14.73%ONLINE    1970176.0M
  repo_wsyyt               shared    1           14.73%ONLINE    1970176.0M
导入VM模板
[root@x5odadb0 ~]# oakcli import vmtemplate -h
Usage:
oakcli import vmtemplate <vmtemplatename> { -assembly <assembly file> | -files <image files> } -repo <repo_name> [-node <0|1>]
where:
         vmtemplate            - Imports a VMtemplate
         -assembly             - Single Assembly file. The file format should be ".ova"
         -files                - Comma separated list of image files or files with archive format
         -repo                 - Repository for this template
         -node                 - Node on which Shared Repo is located
[root@x5odadb0 ~]# oakcli import vmtemplate OL6U8 -assembly /OVS/OVM_OL6U8_x86_64_PVHVM.ova -repo repo_app -node 0
Imported VM Template
[root@x5odadb0 ~]# oakcli show vmtemplate
        NAME                                            MEMORY          VCPU            REPOSITORY
        OL6U8                                           2048M              2            repo_app
[root@x5odadb0 ~]#
[root@x5odadb0 ~]# oakcli show vmtemplate OL6U8
The Resource is : OL6U8
        CPUPriority     :       100
        Desc            :
        Disks           :       |file:/OVS/Repositories/repo_app/.A
                                CFS/snaps/otml_OL6U8/Templates/otml
                                _OL6U8/55bf10afe3284225973627580a59
                                f690.img,xvda,w|
        Domain          :       XEN_PVM
        IsSharedRepo    :       true
        Keyboard        :       en-us
        MaxMemory       :       2048M
        MaxVcpu         :       2
        Memory          :       2048M
        Mouse           :       OS_DEFAULT
        Name            :       OL6U8
        Networks        :
        NodeNum         :       0
        OS              :       OL_5
        ProcessorCap    :       100
        RepoName        :       repo_app
        Vcpu            :       2

[root@x5odadb0 ~]#
克隆VM
可以从模板克隆,也可以从现有虚拟机克隆
oakcli clone      - Clones a VM given VMtemplate name and repository (or)
                  - Clones a VM given a VM (or)
                  - Clones a VM given a VMtemplate (or)
                  - Clones a VDisk given a VDisk
[root@x5odadb0 ~]# oakcli clone -h
Usage:
oakcli clone {vm <vm_name> | vdisk <vdisk_name>} [<options>]
where:
         vm_name               - Name of the VM to be cloned
         vdisk_name            - Name of the VDisk to be cloned from existing VDisk
[root@x5odadb0 ~]# oakcli clone vm -h
Usage:
oakcli clone vm <vm_name> -vmtemplate <template_name> -repo <repo_name> [-node <0|1>] [-driverdomain]
oakcli clone vm <vm_name> -vm <src_vm_name> -snap [-force] [-driverdomain]
oakcli clone vm <vm_name> -vmtemplate <src_vmtempl_name> -snap [-driverdomain]
where:
         vm_name               - Name of the VM
         -vm                   - Source VM for creating a snapshot
                               - 'force' option will allow to take snapshots of online VM
         -vmtemplate           - VMtemplate name
         -repo                 - Repository of VMtemplate
         -node                 - Node on which Shared Repo is located
         -driverdomain         - cloning a vm in driver domain mode


[root@x5odadb0 ~]#                
[root@x5odadb0 ~]# oakcli clone vm ol6u8_t2 -vmtemplate OL6U8 -repo vdisk1 -node 0
Cloned VM : ol6u8_t2
[root@x5odadb0 ~]#
[root@x5odadb0 ~]# oakcli clone vm cj-2 -vm cj-1 -snap
Cloned VM : c2-1
[root@x5odadb0 ~]# oakcli show vm
创建Vdisk

Vdisk分两种:一种是local,另外一种是shared。shared的vdisk可以被多个VM共享,类似于RAC中共享磁盘一样,从目前来看shared vdisk仅支持在同一repo中,Vdisk也可以被resize。

oakcli create vdisk sdisk1 -repo repo2 -size 1G -type shared
为虚拟机增加vdisk(如果是shared vdisk,可以被多个VM共享)
[root@x5radqdb1 ~]# oakcli modify vm test -attachvdisk dbvshare
Configured VM : test. Changes are available in VM.
[root@x5radqdb1 ~]# oakcli configure vmtemplate OL6U8 -vcpu 2 -maxvcpu 4 -cpucap 40 -memory 1536M -maxmemory 2G -os OTHER_LINUX

如何修改虚拟机中磁盘的大小

You can do this though it will require the VM downtime.
1. Stop the VM via oakcli.
2. cd to your vm directory:  cd /u01/app/sharedrepo/<shared repo name>/.ACFS/snaps/<VM name>/VirtualMachines/<VM name>/
3. Add the space to your virtual disk (in this example 30G): dd if=/dev/zero bs=1G count=30 >> your_disk_file
4. Start your VM with oakcli.
5. In the VM use fdisk or Disk utility to create basic partition on the added free space, then initialize it to LVM, add to your root VG and extend the root LV.

有时候,虚拟机模板中磁盘容量比较小,可以通过这种方式去修改,然后通过fdisk或磁盘工具来调整磁盘的大小。


Reference
http://docs.oracle.com/cd/E86648_01/index.htm
http://docs.oracle.com/cd/E22693_01/doc.12/e55580/vmadmin.htm


关键词:odavp x5-2 cloud 

相关文章

拥抱开源
How to Integrate Ten Different Oracle Public PaaS Services
Oracle Cloud - MAA架构演示
Oracle Code北京携手开发者点燃代码激情,领航云时代应用开发
甲骨文获评Gartner “2017移动应用开发平台魔力象限领导者”
老P观云:大型企业上云的制胜法宝
老P观云:中小企业如何赢得云端创新之战?
老P观云:关于IaaS的几点预测
ODA X5-2 IO Calibration
ODA存储诊断工具odasundiag.sh and oakcli stordiag
Oracle Database Appliance Manager Configurator
通过ODA虚拟化构建私有云平台

联系我们

韩朝阳



    Phone:186-9589-1286

    E-mail:ohsdba@qq.com

    微  信: ohsdba


电话(186-9589-1286)

QQ(375349564)

微信(ohsdba)


常用链接

Oracle
eDelivery
My Oracle Support

Exadata 12.1 Document

Exadata 12.2 Document

Oracle 11gR2 Document

Oracle 12cR1 Document

Oracle 12cR2 Document

GoldenGate 12c

Oracle Fusion Middleware

Mysql Document

PostgreSQL

Python

github

sourceforge



Top
Cell186-9589-1286
QQ 375349564
E-mail ohsdba@qq.com