Custom Search

Sunday, June 26, 2005

Managing Disks and Disk groups (getting into the useful stuff)

Managing Disks and Disk groups (getting into the useful stuff)

After 3.2 you can use enclosure names to get away from OS dependent pathing. So if you want to call a certain array “blue” and another one “red” you can do so.

The following are reserved disk group names: bootdg, defaultdg, nodg.

If you’ve encapsulated your root disk, bootdg is an alias for the volumes that are used to boot the system.

“defaultdg” is an alias for the disk group that should be assumed if the –g option is not specified on a command.

By default, both bootdg and defaultdg are set to nodg.

A default disk group can be specified with: vxdctl defaultdg diskgroup


Disk Configuration Stages

1. Initialize the disk
2. Assign disk to a disk group
3. Assign disk space to volumes


Creating a Disk Group

You can add a single disk or multiple disks.
You cannot add a disk to more than one disk group
Disk media names must be unique within a disk group
Adding a disk to a disk group makes the disk space available for use in creating VM volumes.


Creating a Disk Group: VEA

Select Actions-> New Disk Group
Specify a name
Add at least one disk
Specify disk media names for the disks added
To add another disk: Actions-> Add Disk to Disk Group

Creating a Disk Group: vxdiskadm
“Add or initialize one or more disks”

Creating a Disk Group: CLI
Initialize disk(s):
vxdisksetup –i device_tag [attributes]
i.e. vxdisksetup –i c2t0d0

Initialize disk group by adding at least one disk:
vxdg init diskgroup disk_name=device_tag
i.e. vxdg init newdg newdg01=c2t0d0

Add more disks to the disk group:
vxdg –g diskgroup adddisk disk_name=device_tag
i.e. vxdg –g newdg adddisk newdg02=c2t1d0


Viewing All Disks: VEA

In VEA, disks are represented under the Disks node in the object tree, in the Disk View window, and in the grid for several object types, including controllers, disk groups, enclosures, and volumes.

The status of a disk can be:
Not Initialized: The disk is not under VxVM control
Free: The disk is in the free disk pool; it is initialized by VxVM but is not in a disk group
Foreign: The disk is under the control of another host
Imported: The disk is in an imported disk group
Deported: The disk is in a deported disk group
Disconnected: The disk contains subdisks that are not available because of hardware failure
External: The disk is in use by a foreign manager, such as Logical Volume Manager


Viewing Disk Information: CLI

vxdisk –o alldgs list

In the output:
Status of online – disk is under VxVM control and is available for creating volumes
Status of online invalid – disk is not under VxVM control

Viewing Detailed Information: CLI

vxdisk –g diskgroup list disk_name
i.e. vxdisk –g datadg list datadg01


Viewing Disk Groups: CLI

Display imported disk groups only - vxdg list
Display all disk groups, including deported disk groups – vxdg –o alldgs list
Display free space – vxdg free


Creating a Non-CDS Disk and Disk Group

To initialize a disk as a sliced disk:
vxdisksetup –i device_tag format=sliced

To initialize a non-CDS disk group:
vxdg init diskgroup disk_name=device_tag cds=off


Before Removing a Disk

Either move the disk to the free disk pool or return disk to an uninitialized state.
You cannot remove the last disk in a disk group, unless you destroy the disk group.
Before removing a disk, ensure that the disk does not contain needed data.


Evacuating a Disk

Before removing a disk you may need to evacuate data to another disk.

VEA:
Select disk to be evacuated
Select Actions -> Evacuate Disk

vxdiskadm:
“Move volumes from a disk”

CLI:
vxevac –g diskgroup from_disk [to_disk]
i.e vxevac –g datadg datadg02 datadg03

If the “to disk” is not specified VM will find the space for you.


Removing a Disk from VxVM

VEA:
Select disk to be removed
Select Actions -> Remove Disk from Dynamic Disk Group

vxdiskadm:
“Remove a disk”

CLI:
vxdg –g diskgroup rmdisk disk_name
i.e. vxdg –g newdg rmdisk newdg02

vxdiskunsetup [-C] device_tag
i.e vxdiskunsetup c0t2d0


Renaming a Disk

VEA:
Select disk to be renamed
Select Actions -> Rename Disk
Specify the original disk name and the new name

CLI:
vxedit –g diskgroup rename old_name new_name

Note:
The new disk name must be unique within the disk group
Renaming a disk does not automatically rename subdisks on the disk.


Deporting a Disk Group: VEA
Select Actions -> Deport Disk Group


Deporting a Disk Group: vxdiskadm
“Remove access to (deport) a disk group”


Deporting a Disk Group: CLI

Deport: vxdg deport diskgroup
Deport and rename: vxdg –n new_name deport old_name
Deport to a new host: vxdg –h hostname deport diskgroup


Importing a Disk Group: VEA
Select Actions -> Import Disk Group


Importing a Disk Group: vxdiskadm
“Enable access to (import) a disk group”


Importing a Disk Group: CLI
Import: vxdg import diskgroup
After import, start all volumes: vxvol –g diskgroup startall

To import and rename a disk group: vxdg –n new_name import old_name
To import and rename temporarily: vxdg –t –n new_name import old_name
To clear import locks: vxdg –tC –n new_name import old_name


Renaming a Disk Group:
VEA: Actions -> Rename Disk Group
CLI: follow directions on deporting and importing a disk group to rename.


Destroying a Disk Group:
VEA: Actions -> Destroy Disk Group
CLI: vxdg destroy diskgroup