Oracle® ZFS Storage Appliance 管理指南,发行版 OS8.6.0

退出打印视图

更新时间: 2016 年 7 月
 
 

克隆复制数据包 (CLI)

基于最近收到的复制快照克隆复制数据包。

在创建克隆的项目时,通过遵循以下准则以避免命名冲突:

  • 克隆的项目必须具有不会与同一个池中任何现有项目冲突的唯一名称。

  • 克隆项目的任何共享资源的挂载点和 SMB 资源名称不得与任何现有挂载点或 SMB 资源名称发生冲突。

  • 对于继承项目属性的共享资源,可以通过覆盖项目级挂载点和/或 SMB 资源名称来解决冲突。

  • 对于不从项目继承属性的共享资源,可以设置一个将附加到挂载点和/或 SMB 资源名称末尾的后缀来解决冲突,或者分别为每个共享资源覆盖挂载点和/或 SMB 资源名称。

使用以下过程克隆复制数据包。

在 CLI 中,您也可以通过单独覆盖每个共享资源的属性来解决冲突。

  1. 在目标设备中,转到 shares replication sources 并选择要克隆的复制数据包的源。
    hostname:shares replication sources> select source-000
    hostname:share replication sources source-000>
  2. 选择要克隆的复制数据包。
    hostname:shares replication source-000> select package-004
    hostname:shares replication source-000 package-004>

    您可以使用 list 命令查看该源中可用的所有复制数据包。

    hostname:shares replication source-000> list
    PROJECT                        STATE           LAST UPDATE
    package-000 p3                 idle            Tue Apr 21 2015 19:50:43 GMT+0000 (UTC)
    package-001 p2                 idle            Mon Apr 27 2015 17:05:16 GMT+0000 (UTC)
    package-002 p1                 idle            Mon Apr 27 2015 17:00:25 GMT+0000 (UTC)
    package-003 p4                 idle            Tue Apr 21 2015 21:37:16 GMT+0000 (UTC)
    package-004 store              idle            Mon Apr 27 2015 16:40:26 GMT+0000 (UTC)
    hostname:shares replication source-000>
  3. 输入 clone 创建新的克隆项目。
    hostname:shares replication source-000 package-004> clone
    hostname:shares replication source-000 package-004 clone>
  4. target_project 设置为项目名称。

    项目名称必须唯一,否则克隆操作将失败。

    项目名称必须包含 1 到 64 个字符,但是不能包含空格或以句点开头。允许的字符为:字母数字和特殊字符 _ - . :

    hostname:shares replication source-000 package-004 clone> set target_project=clone
    target_project = clone
  5. 输入 conflicts 检查是否存在冲突。

    如果存在冲突,将显示类似以下内容的消息。

    hostname:shares replication source-000 package-004 clone> conflicts
    
    Cloning cannot proceed because the following shares have mountpoints or
    SMB resource names that are invalid or conflict with those of other shares (either on the
    system or also being failed over). Please specify valid mountpoints or SMB resource names for
    these shares:
         
    SHARE          MOUNTPOINT                      SHARESMB 
    appliances     /export/appliances              appliances 
    clothes        /export/clothes  (inherited)    clothes  (inherited)
    electronics    /export/electronics             electronics 
    furniture      /export/furniture  (inherited)  furniture  (inherited)
    groceries      /export/groceries  (inherited)  groceries  (inherited)
    health         /export/health  (inherited)     health  (inherited)
    toys           /export/toys                    toys
    
    hostname:shares replication source-000 package-004 clone>

    在此过程中,可以随时使用此命令来检查是否存在冲突。

  6. (u53ef选) 设置项目级属性来解决从项目继承属性的共享资源的冲突。

    使用 get 命令来查看克隆的属性。

    hostname:shares replication source-000 package-004 clone> get
    
    target_project = (unset)
    rename_suffix =
    original_mountpoint = /export
    mountpoint = /export
    original_smb_resource_name = share
    smb_resource_name = share

    属性 original_mountpoint 显示了当前挂载点。属性 original_smb_resource_name 显示当前资源名称。

    1. 为该克隆输入唯一的项目级别的挂载点。

      此设置将应用于从项目继承挂载点的共享资源。将 original_mountpoint 设置为 true。使用 set mountpoint 指定克隆的唯一挂载点。

      hostname:shares replication source-000 package-004 clone> set original_mountpoint=true
      hostname:shares replication source-000 package-004 clone> set mountpoint=/export/clone
      hostname:shares replication source-000 package-004 clone>
    2. 输入唯一的项目级别的 SMB 资源名称。

      此设置将应用于从项目继承 SMB 资源名称的共享资源。将 original_smb_resource_name 设置为 true。将 smb_resource_name 设置为唯一的 SMB 资源名称。

      hostname:shares replication source-000 package-004 clone> set original_smb_resource_name=true
      hostname:shares replication source-000 package-004 clone> set smb_resource_name=clone-share
                       smb_resource_name = clone-sharesmb
    3. 设置 rename_suffix 以解决其他共享资源冲突。

      如果发生冲突,此属性会创建附加到挂载点和/或 SMB 资源名称的后缀。

      hostname:shares replication source-000 package-004 clone> set rename_suffix=-clone

      注 -  此操作将覆盖继承。例如,如果某个共享资源最初从项目继承了挂载点,但在克隆期间使用后缀对该挂载点进行重命名,那么新克隆项目中的共享资源不再继承其挂载点,而是使用重命名后的唯一挂载点。
  7. 设置单个共享资源的属性:
    1. 选择一个共享资源。
      hostname:shares replication source-000 package-004 clone> select appliances
    2. 覆盖其挂载点和/或 SMB 资源名称,或设置 rename_suffix

      以下示例将覆盖共享资源的挂载点。

      hostname:shares replication source-000 package-004 clone appliances> set original_mountpoint=/export
      hostname:shares replication source-000 package-004 clone appliances> set mountpoint=/export/clone
  8. 输入 confirm commit 以启动克隆操作。
    hostname:shares replication source-000 package-004 clone> confirm commit

    如果检测到名称冲突,将显示类似以下内容的消息:

    Cloning cannot proceed because the following shares have mountpoints or
    SMB resource names that are invalid or conflict with those of other shares (either on the
    system or also being failed over). Please specify valid mountpoints or SMB resource names for
    these shares:
         
    SHARE          MOUNTPOINT                      SHARESMB 
    appliances     /export/appliances              appliances 
    clothes        /export/clothes  (inherited)    clothes  (inherited)
    electronics    /export/electronics             electronics 
    furniture      /export/furniture  (inherited)  furniture  (inherited)
    
    hostname:shares replication source-000 package-004 clone>
  9. (u53ef选) 解决任何剩余的名称冲突。

    重复步骤 6 和 7,直到冲突全部解决为止。

相关主题