0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AIX 7.2TL5: mksysbとcreate_ovaコマンドを使用した ovaイメージ・ファイルの作成

Last updated at Posted at 2020-11-23

前の記事では、稼働中のrootvg から ova イメージ・ファイルを作成しましたが、今回は mksysb からova イメージ・ファイルを作成します。


検証シナリオ

既存の mksysb イメージをターゲット・ディスク hdisk2 にリストアしその内容を /test ディレクトリーに ova パッケージを作成する。

# lspv
hdisk0          00fxxxxxx58e97xx                    rootvg          active
hdisk1          00cxxxxxxd204xxx                    testvg          active
hdisk2          none
検証環境

・AIXサーバー: 7.2 TL5 SP1
 (用意したディスク)
   rootvg 20GB (hdisk0)
   代替インストール用ディスク 20GB (hdisk2)
   ova パッケージング用ディスク領域 60GB (hdisk1)

環境確認

・ oslvel

# oslevel -s
7200-05-01-2038

・コマンド使用方法確認

# create_ova -h
Usage create_ova: Creates a consummable (single) disk image for PowerVC import activity.

create_ova -o <output directory> [-d <target disk>] [-i <image src file>]
        [-t <os_type>] [-e] [-f]


-o      Specifies output directory for ova asset.

-d      Specifies logical disk target for image restoration/copy.

-i      Specifies an image source file of type: mksysb or raw disk.

-t      Specifies os-type of image source file. Supported types: aix|rhel|sles

-e      Copy volume data of disk target (excludes image restoration).

-f      Ignore filesystem space warnings.

・使用するmksysbの確認

# ls -l /mksysb/mksysb
total 3728808
-rw-r--r--    1 root     system   1909145600 Nov 23 05:44 mksysb

mksysb サイズは 2GBくらいです。

実行
# time create_ova -o /test -i /mksysb/mksysb -f -d hdisk2
Initializing resources ...


Checking for resource group MKSYSB...Checking /tmp space requirement...done
x ./bosinst.data
Checking hdisk2 space requirement...done
Executing command:
alt_disk_mksysb -B -c /dev/vty0 -d hdisk2 -m /mksysb/mksysb
Restoring /image.data from mksysb image.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating logical volume alt_hd11admin.
Creating logical volume alt_lg_dumplv.
Creating logical volume alt_livedump.
Creating logical volume alt_repo00.
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/usr/sys/inst.images file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump file system.
Restoring mksysb image to alternate disk(s).
Linking to 64bit kernel.
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr/sys/inst.images
forced unmount of /alt_inst/usr/sys/inst.images
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Fixing file system superblocks...

Checking for resource group PIPEVIEWER...already installed.
Checking /test space requirement...done

Checking for resource group aix_1606137482.img...
2048020.0GiB 0:08:52 [38.5MiB/s] [38.5MiB/s] [======================================================================>] 100%       0    +
 records in
20480+0 records out
41943040+0 records in
41943040+0 records out
done

Checking for resource group aix_1606137482.ova.gz...
Checking /test space requirement...done
a ./aix_1606137482.ovf 4 blocks
a ./aix_1606137482.img 41943040 blocks
20.0GiB 0:11:39 [29.3MiB/s] [29.3MiB/s] [======================================================================>] 100%

Done verifying resources.

real    25m21.30s
user    4m57.30s
sys     2m40.67s
#
# echo $?
0
# ls -l /test
total 1963120
-rw-r--r--    1 root     system   1005116218 Nov 23 07:43 aix_1606137482.ova.gz
drwxr-xr-x    2 root     system          256 Nov 23 05:17 lost+found
#

すでに create_ova 実行に必要なrpmモジュールを導入した環境では、コマンド実行から終了までは25分程度かかりました。

mksysb が hdisk2 にリストアされてそこからovaイメージ・ファイルが作成されています。

# lspv
hdisk0          00fxxxxxx58e97xx                    rootvg          active
hdisk1          00cxxxxxxd204xxx                    testvg          active
hdisk2          0xxxxxxd0fxxx527                    altinst_rootvg

-> hdisk2 は 代替rootvg ディスクとして使用されています。


まとめ

既存のmksysbからもAIX OS上でovaイメージ・ファイルが作成できることを確認しました。

以上です。

参考:
・create_ova コマンド
https://www.ibm.com/support/knowledgecenter/ja/ssw_aix_72/c_commands/create_ova.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?