How to move volumes to another diskgroup.

book

Article ID: 100002188

calendar_today

Updated On:

Resolution

Notice one diskgroup cdsdg with two volumes testvol that has multiple disks, and test2 with a single disk:

(/) ms1# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
c0t0d0s2     auto:none       -            -            online invalid
c0t1d0s2     auto:none       -            -            online invalid
c1t0d0s2     auto:cdsdisk    t0           cdsdg        online
c1t1d0s2     auto:cdsdisk    t1           cdsdg        online
c1t2d0s2     auto:cdsdisk    t2           cdsdg        online
c1t3d0s2     auto:cdsdisk    t3           cdsdg        online
c1t4d0s2     auto:cdsdisk    t4           cdsdg        online
c1t5d0s2     auto:cdsdisk    t5           cdsdg        online
c1t8d0s2     auto:sliced     -            -            online
c1t9d0s2     auto:sliced     -            -            online
c1t10d0s2    auto:sliced     -            -            online
c1t11d0s2    auto:sliced     -            -            online
c1t13d0s2    auto:sliced     -            -            online


(/) ms1# vxprint -qhtg cdsdg
dg cdsdg        default      default  19000    1266597139.41.ms1

dm t0           c1t0d0s2     auto     2048     17679776 -
dm t1           c1t1d0s2     auto     2048     17679776 -
dm t2           c1t2d0s2     auto     2048     17679776 -
dm t3           c1t3d0s2     auto     2048     17679776 -
dm t4           c1t4d0s2     auto     2048     17679776 -
dm t5           c1t5d0s2     auto     2048     35365968 -

v  testvol      -            ENABLED  ACTIVE   2048000  SELECT    testvol-01 fsgen
pl testvol-01   testvol      ENABLED  ACTIVE   2048000  STRIPE    4/128    RW
sd t1-02        testvol-01   t1       0        256000   0/0       c1t1d0   ENA
sd t1-04        testvol-01   t1       358400   256000   0/256000  c1t1d0   ENA
sd t4-02        testvol-01   t4       0        512000   1/0       c1t4d0   ENA
sd t5-02        testvol-01   t5       0        512000   2/0       c1t5d0   ENA
sd t2-03        testvol-01   t2       204800   512000   3/0       c1t2d0   ENA

v  test2        -            ENABLED  ACTIVE   204800   SELECT    -        fsgen
pl test2-01     test2        ENABLED  ACTIVE   204800   CONCAT    -        RW
sd t0-01        test2-01     t0       0        204800   0         c1t0d0   ENA


This is the command to split the testvol volume to a new diskgroup testdg(it can be an existing diskgroup as well):
(/) ms1# vxdg split cdsdg testdg testvol


Notice how all the disks that were part of that volume were moved to the testdg diskgroup after the split:
(/) ms1# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
c0t0d0s2     auto:none       -            -            online invalid
c0t1d0s2     auto:none       -            -            online invalid
c1t0d0s2     auto:cdsdisk    t0           cdsdg        online
c1t1d0s2     auto:cdsdisk    t1           testdg       online
c1t2d0s2     auto:cdsdisk    t2           testdg       online
c1t3d0s2     auto:cdsdisk    t3           cdsdg        online
c1t4d0s2     auto:cdsdisk    t4           testdg       online
c1t5d0s2     auto:cdsdisk    t5           testdg       online
c1t8d0s2     auto:sliced     -            -            online
c1t9d0s2     auto:sliced     -            -            online
c1t10d0s2    auto:sliced     -            -            online
c1t11d0s2    auto:sliced     -            -            online
c1t13d0s2    auto:sliced     -            -            online



The newly created diskgroup from the split leaves the volume disabled, and needs to be started with the vxvol command:
(/) ms1# vxprint -qhtg testdg
dg testdg       default      default  25000    1278686092.31.ms1

dm t1           c1t1d0s2     auto     2048     17679776 -
dm t2           c1t2d0s2     auto     2048     17679776 -
dm t4           c1t4d0s2     auto     2048     17679776 -
dm t5           c1t5d0s2     auto     2048     35365968 -

v  testvol      -            DISABLED ACTIVE   2048000  SELECT    -        fsgen
pl testvol-01   testvol      DISABLED ACTIVE   2048000  STRIPE    4/128    RW
sd t1-02        testvol-01   t1       0        256000   0/0       c1t1d0   ENA
sd t1-04        testvol-01   t1       358400   256000   0/256000  c1t1d0   ENA
sd t4-02        testvol-01   t4       0        512000   1/0       c1t4d0   ENA
sd t5-02        testvol-01   t5       0        512000   2/0       c1t5d0   ENA
sd t2-03        testvol-01   t2       204800   512000   3/0       c1t2d0   ENA


(/) ms1# vxvol -g testdg start testvol
(/) ms1# vxprint -qhtg testdg
dg testdg       default      default  25000    1278686092.31.ms1

dm t1           c1t1d0s2     auto     2048     17679776 -
dm t2           c1t2d0s2     auto     2048     17679776 -
dm t4           c1t4d0s2     auto     2048     17679776 -
dm t5           c1t5d0s2     auto     2048     35365968 -

v  testvol      -            ENABLED  ACTIVE   2048000  SELECT    testvol-01 fsgen
pl testvol-01   testvol      ENABLED  ACTIVE   2048000  STRIPE    4/128    RW
sd t1-02        testvol-01   t1       0        256000   0/0       c1t1d0   ENA
sd t1-04        testvol-01   t1       358400   256000   0/256000  c1t1d0   ENA
sd t4-02        testvol-01   t4       0        512000   1/0       c1t4d0   ENA
sd t5-02        testvol-01   t5       0        512000   2/0       c1t5d0   ENA
sd t2-03        testvol-01   t2       204800   512000   3/0       c1t2d0   ENA



Notice how the cdsdg diskgroup is left with two devices in it now, and a single volume test2:
(/) ms1# vxprint -qhtg cdsdg
dg cdsdg        default      default  19000    1266597139.41.ms1

dm t0           c1t0d0s2     auto     2048     17679776 -
dm t3           c1t3d0s2     auto     2048     17679776 -

v  test2        -            ENABLED  ACTIVE   204800   SELECT    -        fsgen
pl test2-01     test2        ENABLED  ACTIVE   204800   CONCAT    -        RW
sd t0-01        test2-01     t0       0        204800   0         c1t0d0   ENA
(/) ms1#


When an object such as a volume in this case is split, all of the objects like disks that are part of it will be moved as well because a disk can only belong to one diskgroup.


Moving to a new, or an existing diskgroup should not make a difference. If you want to move disks use "move", and for objects like volumes "split" is best. Please see both entries from the man page to determine what's best for your situation.


  move      Moves the specified objects  together  with  their
            hierarchies  from  the imported source disk group,
            sourcedg, to the imported target disk group,  tar-
            getdg.
            The items in the object  list  must  be  top-level
            objects,   disk   media  objects  or  disk  access
            objects.  The list must  define  a  set  of  self-
            contained  objects, unless the -o expand option is
            specified.  (Self-contained means that  the  disks
            used  by  the  selected objects should not contain
            any objects that are not selected for  the  move.)
            If  the  -o expand option is specified, the object
            set is expanded to be self-contained.
            The source disk group and target disk  group  must
            both  be  either  private  or shared.  If one disk
            group is private and the other is  shared,  deport
            and  reimport  the  private  disk  group as shared
            before performing the move.
            See vxdg join for a description of  the  usage  of
            the -o override and -o verify options.

    split     Moves the specified objects  together  with  their
              hierarchies  from  the imported source disk group,
              sourcedg, to a newly created  target  disk  group,
              targetdg.
              This operation fails if it would  remove  all  the
              disks  from  the  source  disk  group,  or  if  an
              imported disk group exists with the same  name  as
              the target disk group.
              An existing deported disk group  may  be  imported
              under  a different name if it has the same name as
              the target disk group (as is the case for the vxdg
              init command).
              The items in the object  list  must  be  top-level
              objects,   disk   media  objects  or  disk  access
              objects.  The list must  define  a  set  of  self-
              contained  objects, unless the -o expand option is
              specified.  (Self-contained means that  the  disks
              used  by  the  selected objects should not contain
              any objects that are not selected for  the  move.)
              If  the  -o expand option is specified, the object
              set is expanded to be self-contained.
              The newly created target disk group is imported as
              shared  if the source disk group is shared; other-
              wise, it is imported as private.  The -C, -f,  and
              -t  options  are  import  options for the new disk
              group. See the  description  of  vxdg  import  for
              details of their use.
              See vxdg join for a description of  the  usage  of
              the -o override and -o verify options.


 
 

 

Issue/Introduction

How to move volumes to another diskgroup.