Vous êtes sur la page 1sur 5

Lun Masking

LUN MASKING USING VCM database

 In previous session total 15 devices have been created and are made visible
to hosts through mapping.
 Once the Luns are mapped, to enable host to access and perform I/O and
hide the Luns from unwanted hosts, the Luns should be masked.
 To mask the Luns, VCM database should be created and the information
related to Luns and the hosts should be updated to VCM database
 Dedicate a drive to VCM database (In our scenario it is 0000)

LAB EXERCISE

1) create a command file


Sun1# vi myvcm
set device 0000 attribute =vcmdb;
wq!

2) Run symconfigure
Sun1# symconfigure –sid 277 -v –f myvcm -commit –nop

3) Update sym_api.db
Sun1# symcfg discover

4) start vcmdb
(Strictly prohibited to use, it makes all hosts unreachable to storage)
Sun1# symmask db –sid 277 init –f myvcm

5) List masked devices


Sun1#symmaskdb list database

6) Display HBA
Sun1#symmask list hba

7) Discover HBA
Sun1#symmask discover hba

8) Assign lun to Sun1 and update vcmdb


Sun1#symmask –sid 277 add dev 0001 –wwn 10000000 -p 0 –dir 16c
Sun1#symmask –sid 277 add dev 0001 –wwn 10000000 -p 0 –dir 15c
Sun1#symmask –sid 277 add dev 0001 –wwn 10000000 -p 0 –dir 1c
Sun1#symmask –sid 277 add dev 0001 –wwn 10000000 -p 0 –dir 2c

9) Refresh the database


Sun1# symmask refresh
10) Create an alias to host wwn
- To check the wwn number of host
Sun1# fcinfo or symmask list hba

- To create an alias
Sun1#symmask –sid 277 –wwn 10000000000 rename Sun1/port0

- Refresh the database


Sun1# symmask refresh

11)Check the status of ports and enable vcm flag if disabled


Sun1# symcfg –sid 277 –v list -p 0 -sa 1c
Sun1# symcfg –sid 277 –v list -p 0 -sa 2c
Sun1# symcfg –sid 277 –v list -p 0 -sa 16c
Sun1# symcfg –sid 277 –v list -p 0 -sa 15c

(Note: Participants are requested, not to execute the steps to enable VCM
flags on ports in lab sessions as they raise complications, please follow
the demo by y our instructor attentively)

12)create a command file to enable vcm port flag on all ports, before running
the configuration ,make sure the concerned port is offline, once the configuration
is save, bring the port online

On director 1c port0

a) Create a command file


Sun1# vi vcmport
Set port 1c:0 VCM_STATE = enable;
Wq

b) Offline the port


Sun1# symcfg –sid 277 offline –dir 1c –p 0

c) Run the configuration


Sun1# symconfigure –sid 277 –v –f vcmport commit –nop

d) Online the port


Sun1# symcfg –sid 277 online –dir 1c –p 0

e) Refresh the database


Sun1#symmask refresh

f) Update sym_api.db
Sun1#symcfg discover
On director 2c port0

a) Create a command file


Sun1# vi vcmport
Set port 2c:0 VCM_STATE = enable;
Wq

b) Offline the port


Sun1# symcfg –sid 277 offline –dir 2c –p 0

c) Run the configuration


Sun1# symconfigure –sid 277 –v –f vcmport commit –nop

d) Online the port


Sun1# symcfg –sid 277 0nline –dir 2c –p 0

e) Refresh the database


Sun1#symmask refresh

f) Update symapi_db.bin
Sun1#symcfg discover

On director 15c port0

a) Create a command file


Sun1# vi vcmport
Set port 15c:0 VCM_STATE = enable;
Wq:

b) Offline the port


Sun1# symcfg –sid 277 offline –dir 15c –p 0

c) Run the configuration


Sun1# symconfigure –sid 277 –v –f vcmport commit –nop

d) Online the port


Sun1# symcfg –sid 277 0nline –dir 15c –p 0

e) Refresh the database


Sun1#symmask refresh

f) Update symapi_db.bin
Sun1#symcfg discover
On director 16c port0
a) Create a command file
Sun1# vi vcmport
Set port 16c:0 VCM_STATE = enable;
Wq:

b) Offline the port


Sun1# symcfg –sid 277 offline –dir 16c –p 0

c) Run the configuration


Sun1# symconfigure –sid 277 –v –f vcmport commit -nop

d) Online the port


Sun1# symcfg –sid 277 online –dir 16c –p 0

e) Refresh the database


Sun1#symmask refresh

f) Update symapi_db.bin
Sun1#symcfg discover

13) Configure the controller


a) Check the controller
Sun1#fcinfo or cfgadm –al

b) Configure the controller(e.g. C3)


Sun1#cfgadm –c configure c3

C) Update symapi_db.bin
Sun1#symcfg discover

14)List the devices assigned to the host


Sun1# symmaskdb list database

Now mount the device on the host.

1. Bring the LUN under the control of veritas volume manager.


a) Enable dmp controller of Veritas Volume Manager
i. List the controller
Sun1# vxdmpadm list ctlr

ii. If the controller is found disabled, enable it.


Sun1# vxdmpadm – c enable ctlr c3

iii. Configure the controller at OS level.


Sun1# cfgadm – c configure c3.

iv. Search the disks


Sun1# format
v. Identify the device with the help of syminq and label the disks.
Once disk is labeled.
Sun1# vxdisk scandisks

vi. List the disks


Sun1# vxdisk list

vii. Initialize the disk


Sun1# vxdisksetup –i emc01_1

viii. Create a volume manager disk (vmdisk) by creating a disk


group.
Sun1# vxdg init Sun1dg disk1=emc01_1

ix. Create volume using vxassist


Sun1# vxassist –g Sun1dg make vol07 100m

x. Verify the disk groups


Sun1# vxdisk – o list alldgs

xi. Check the volumes


xii. Sun1# vxprint – h

xiii. Create the file system on the volume.


Sun1# newfs /dev/vx/rdsk/Sun1dg/vol07

xiv. Create a mount point


Sun1# mkdir /stdvol

xv. Mount the volume


Sun1# mount /dev/vx/dsk/Sun1dg/vol07 /stdvol

xvi. Add some data


Sun1# cd /stdvol
Sun1# cp /etc/f* .

xvii. Check the data


Sun1# ls

xviii. Unmount the volume


Sun1# umount /stdvol

xix. Deport the volume


Sun1# vxdg deport Sun1dg

Vous aimerez peut-être aussi