安裝 VDO

  1. 確認 yum repository 已設定好,執行 yum install vdo 安裝 vdo 套件,會連同 kmod-kvdo 及 python3-pyyaml 兩個相依套件一起安裝。
    [root@kvm10 ~]# yum install vdo
    App Stream                                      401 kB/s | 4.3 kB     00:00    
    Base OS                                         828 kB/s | 3.9 kB     00:00    
    Dependencies resolved.
    ================================================================================
     Package              Arch         Version                   Repository    Size
    ================================================================================
    Installing:
     vdo                  x86_64       6.2.0.293-10.el8          BaseOS       682 k
    Installing dependencies:
     kmod-kvdo            x86_64       6.2.0.293-50.el8          BaseOS       348 k
     python3-pyyaml       x86_64       3.12-12.el8               BaseOS       193 k
    
    Transaction Summary
    ================================================================================
    Install  3 Packages
    
    Total download size: 1.2 M
    Installed size: 6.2 M
    Is this ok [y/N]: y
    
  2. 安裝好後,查看 vdo 的輔助說明:
    [root@kvm10 ~]# vdo --help
    usage: vdo [-h] command ...
    
    Manage kernel VDO devices and related configuration information. For help on
    individual commands specify the command followed by --help. Unless otherwise
    noted all commands must be run with root privileges.
    
    optional arguments:
      -h, --help            show this help message and exit
    
    management commands:
      command               description
        activate            Activates one or more VDO volumes. Activated volumes
                            can be started using the 'start' command.
        changeWritePolicy   Modifies the write policy of one or all running VDO
                            volumes.
        create              Creates a VDO volume and its associated index and
                            makes it available.
        deactivate          Deactivates one or more VDO volumes. Deactivated
                            volumes cannot be started by the 'start' command.
                            Deactivating a currently running volume does not stop
                            it.
        disableCompression  Disables compression on one or more VDO volumes. If
                            the VDO volume is running, takes effect immediately.
        disableDeduplication
                            Disables deduplication on one more VDO volumes. If the
                            VDO volume is running, takes effect immediately.
        enableCompression   Enables compression on one or more VDO volumes. If the
                            VDO volume is running, takes effect immediately.
        enableDeduplication
                            Enables deduplication on one or more VDO volumes. If
                            the VDO volume is running, takes effect immediately.
        growLogical         Grows the logical size of a VDO volume. The volume
                            must exist and must be running.
        growPhysical        Grows the physical size of a VDO volume. The volume
                            must exist and must be running.
        list                Displays a list of started VDO volumes. If --all is
                            specified it displays both started and non-started
                            volumes.
        modify              Modifies configuration parameters of one or all VDO
                            volumes. Changes take effect the next time the VDO
                            device is started; already-running devices are not
                            affected.
        printConfigFile     Prints the configuration file to stdout. This command
                            does not require root privileges.
        remove              Removes one or more stopped VDO volumes and associated
                            indexes.
        start               Starts one or more stopped, activated VDO volumes and
                            associated services.
        status              Reports VDO system and volume status in YAML format.
                            This command does not require root privileges though
                            information will be incomplete if run without.
        stop                Stops one or more running VDO volumes and associated
                            services.
    
  3. vdo 查詢 create 命令的輔助說明:
    [root@kvm10 ~]# vdo create --help
    usage: vdo create [-h] -n <volume> --device <devicepath>
                      [--activate {disabled,enabled}]
                      [--blockMapCacheSize <megabytes>]
                      [--blockMapPeriod <period>]
                      [--compression {disabled,enabled}]
                      [--deduplication {disabled,enabled}]
                      [--emulate512 {disabled,enabled}] [--force]
                      [--indexMem <gigabytes>] [--maxDiscardSize <megabytes>]
                      [--sparseIndex {disabled,enabled}] [--uuid <uuid>]
                      [--vdoAckThreads <threadCount>]
                      [--vdoBioRotationInterval <ioCount>]
                      [--vdoBioThreads <threadCount>]
                      [--vdoCpuThreads <threadCount>]
                      [--vdoHashZoneThreads <threadCount>]
                      [--vdoLogicalSize <megabytes>]
                      [--vdoLogicalThreads <threadCount>]
                      [--vdoLogLevel {critical,error,warning,notice,info,debug}]
                      [--vdoPhysicalThreads <threadCount>]
                      [--vdoSlabSize <megabytes>]
                      [--writePolicy {async,async-unsafe,sync,auto}] [-f <file>]
                      [--logfile <pathname>] [--verbose]
    ..........................
      --verbose             Prints commands before executing them.