Wednesday, May 4, 2011

Backing up your VIOS configuration with viosbr


I got to know about this command from Chris Gibson's blog, i would recommend all you AIX folks to visit his site once

Purpose of this command.

Performs the operations for backing up the virtual and logical configuration, listing the configuration, and restoring the configuration of the Virtual I/O Server.
 The viosbr command can be run only by the padmin user.

Pre –Reqs

This vios version should be at 2.1 with fixpack 22 applied on the server.
$ ioslevel
2.1.2.10-FP-22

For more information about the viosbr please check the man page, this will give you the default backup location and user defined location with the options.

$ viosbr -view -list
/home/padmin/cfgbackups/ not found


$ mkdir cfgbackups

$ viosbr -backup -file bvio83_vios_config_bkp

$ viosbr -view -list bvio83_vios_config_bkp.tar.gz
 A tar/gzipped file was created in the cfgbackups directory.
  

$ viosbr -view -file /tmp/bvio83_vios_config_bkp.tar.gz

 Controllers:
============
Name                Phys Loc
----                --------
iscsi0
sissas0             U78A5.001.WIH074C-P1-T5
pager0              U7998.61X.10071FA-V1-C7-L0-L0
vasi0               U7998.61X.10071FA-V1-C7
usbhc0              U78A5.001.WIH074C-P1
usbhc1              U78A5.001.WIH074C-P1
vbsd0               U7998.61X.10071FA-V1-C7-L0
usbhc2              U78A5.001.WIH074C-P1
sata0               U78A5.001.WIH074C-P1-T5
lhea0               U78A5.001.WIH074C-P1
ibmvmc0             U7998.61X.10071FA-V1-C2
ati0                U78A5.001.WIH074C-P1-C5-T1
fcs0                U78A5.001.WIH074C-P1-C6-T1
fcs1                U78A5.001.WIH074C-P1-C6-T2
vts0                U7998.61X.10071FA-V1-C10
fscsi0              U78A5.001.WIH074C-P1-C6-T1
ent0                U78A5.001.WIH074C-P1-T6
fscsi1              U78A5.001.WIH074C-P1-C6-T2
ent1                U78A5.001.WIH074C-P1-T7
ent2                U7998.61X.10071FA-V1-C3-T1
ent3                U7998.61X.10071FA-V1-C4-T1
ent4                U7998.61X.10071FA-V1-C5-T1
ent5                U7998.61X.10071FA-V1-C6-T1
sas0                U78A5.001.WIH074C-P1-T5

Physical Volumes:
=================
Name                Phys Loc
----                --------
hdisk0              U78A5.001.WIH074C-P1-D1
hdisk1              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000402D00000000
hdisk2              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000404B00000000
hdisk3              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4001404B00000000
hdisk4              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4001404C00000000
hdisk5              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000408000000000
hdisk6              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4001408000000000

Optical Devices:
================
Name                Phys Loc
----                --------
cd0

Tape Devices:
=============
Name                Phys Loc
----                --------

Ethernet Interfaces:
====================
Name
----
en0
en1
en2
en3
en4
en5
en6

Storage Pools:
==============
SP Name                       PV Name
-------                       -------
rootvg                        hdisk0


Shared Ethernet Adapters:
=========================
Name                Physical Adapter    Default Adapter     Virtual Adapters
----                ----------------    ---------------     ----------------
ent6                ent0                ent2                ent2


Virtual Server Adapters:
========================
SVSA                Phys Loc                      VTD
----                --------                      ---
vhost0              U7998.61X.10071FA-V1-C11      vtscsi2
                                              vtscsi1
                                                                      vtscsi0

 The –mapping flag provided me with VTD and SEA mappings
(same as lsmap –all and lsmap –all –net)


 $ viosbr -view -file /tmp/bvio83_vios_config_bkp.tar.gz -mapping

SVSA                Physloc                            Client Partition ID
------------------- ---------------------------------- --------------------
vhost0              U7998.61X.10071FA-V1-C11           0x00000003
VTD                      vtscsi0
Status                   Available
LUN                      0x8200000000000000
Backing Device           hdisk1
Physloc                  U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000402D00000000

SVSA                Physloc                            Client Partition ID
------------------- ---------------------------------- --------------------
vhost0              U7998.61X.10071FA-V1-C11           0x00000003 VTD                      vtscsi1
Status                   Available
LUN                      0x8400000000000000
Backing Device           hdisk2
Physloc                  U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000404B00000000

SVSA                Physloc                            Client Partition ID
------------------- ---------------------------------- --------------------
vhost0              U7998.61X.10071FA-V1-C11           0x00000003 VTD                      vtscsi2
Status                   Available
LUN                      0x8100000000000000
Backing Device           hdisk5
Physloc                  U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000408000000000

SVEA    Physloc
------- ---------------------------------------
ent2    U7998.61X.10071FA-V1-C3-T1  
VTD                      ent6
Status                   Available
Backing Device           ent0
Physloc                  U78A5.001.WIH074C-P1-T6

 The –detail flag provided extended configuration information.
 $ viosbr -view -file /tmp/bvio83_vios_config_bkp.tar.gz -detail

Controllers:
============
Name                Phys Loc
----                --------
iscsi0
Attribute Name      Attribute Value
--------------      ---------------
initiator_name      iqn.bvio83.hostid.0a03496c

sissas0             U78A5.001.WIH074C-P1-T5
Attribute Name      Attribute Value
--------------      ---------------
bus_io_addr         0x80000000
intr_lsi            289
dual_init_cfg       default
serial_number       YL3000000001

pager0              U7998.61X.10071FA-V1-C7-L0-L0
vasi0               U7998.61X.10071FA-V1-C7
usbhc0              U78A5.001.WIH074C-P1
..etc..


The –type flag allows you to select details for a particular type of device for example, just SEA configuration information.

$ viosbr -view -file /tmp/bvio83_vios_config_bkp.tar.gz -type sea

Shared Ethernet Adapters:
=========================
Name                Physical Adapter    Default Adapter     Virtual Adapters
----                ----------------    ---------------     ----------------
ent6                ent0                ent2                ent2

 $ viosbr -view -file /tmp/bvio83_vios_config_bkp.tar.gz -type svsa

Virtual Server Adapters:
========================
SVSA                Phys Loc                      VTD
----                --------                      ---
vhost0              U7998.61X.10071FA-V1-C11      vtscsi2
                                                  vtscsi1
                                                  vtscsi0
Listing PV only information.

$ viosbr -view -file /tmp/bvio83_vios_config_bkp.tar.gz -type pv

Physical Volumes:
=================
Name                Phys Loc
----                --------
hdisk0              U78A5.001.WIH074C-P1-D1
hdisk1              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000402D00000000
hdisk2              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000404B00000000
hdisk3              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4001404B00000000
hdisk4              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4001404C00000000
hdisk5              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4000408000000000
hdisk6              U78A5.001.WIH074C-P1-C6-T1-W500507630608059A-L4001408000000000


The –restore and –validate flags validate the devices on the server against the devices in the backup file.

$ viosbr -restore -file bvio83_vios_config_bkp.tar.gz -validate

Dev name during BACKUP                  Is Valid?      Is Deployable?
======================                  =========      ==============
iscsi0                                  YES            NO
sissas0                                 YES            NO
pager0                                  YES            NO
vasi0                                   YES            NO
usbhc0                                  YES            NO
usbhc1                                  YES            NO
vbsd0                                   YES            NO
usbhc2                                  YES            NO
sata0                                   YES            NO
lhea0                                   YES            NO
ibmvmc0                                 YES            NO
ati0                                    YES            NO
fcs0                                    YES            NO
fcs1                                    YES            NO
vts0                                    YES            NO
fscsi0                                  YES            NO
ent0                                    YES            NO
fscsi1                                  YES            NO
ent1                                    YES            NO
ent2                                    YES            NO
ent3                                    YES            NO
ent4                                    YES            NO
ent5                                    YES            NO
sas0                                    YES            NO
hdisk0                                  YES            NO
hdisk1                                  YES            NO
hdisk2                                  YES            NO
hdisk3                                  YES            NO
hdisk4                                  YES            NO
hdisk5                                  YES            NO
hdisk6                                  YES            NO
en6                                     YES            NO
ent6                                    YES            NO
rootvg                                  YES            NO
vhost0                                  YES            YES

This tool looks like a great way to backup and restore your VIOS configuration.
 
Of course backupios will also do this but it will take an image of the entire system not just the virtual and logical mappings.
 
Maybe we could automate the configuration of a VIOS using this tool.

No comments:

Post a Comment