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 

相关文章

Oracle Cloud Native Solutions
Oracle Kubernetes Engine
Terraform,docker,wercker,k8s
Vagrant with oracle
Oracle自治数据仓库云
OMC - How to Install Gateway Agent
Oracle大数据之交互式快速参考
Oracle数据库云服务
Oracle数据库备份云服务
Oracle RAC and Third Party Cloud
Oracle Database Multilingual Engine(MLE)
Oracle GraalVM
Top