主にLinuxサーバー設定記録をメモします


XenServer構築メモ

ゲストOSをグラフィカルインストールする設定

起動オプションにvncを追加する
graphical utf8 vnc ip=XXX.XXX.XXX.XXX netmask=255.255.255.0

XenServerでローカルディスク利用手順

Dom0のLVM領域を縮小して通常のディスクとして利用する方法
XenServerをアップデートする場合はディスクのアンマウントをしておく必要がある
ディスク構成確認
# fdisk -l
LVM領域削除(/dev/sda3を削除する)
# fdisk /dev/sda
The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         523     4194304   83  Linux Partition 1 does not end on cylinder boundary.
/dev/sda2             523        1045     4194304   83  Linux
/dev/sda3            1045       60801   479995393   8e  Linux LVM

Command (m for help): d
Partition number (1-4): 3

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         523     4194304   83  Linux Partition 1 does not end on cylinder boundary.
/dev/sda2             523        1045     4194304   83  Linux
パーティション作成
Command (m for help): n

/dev/sda3 +210000M ← LVM領域として利用(=DomU)
/dev/sda4 残り全部 ← ローカルディスクとして利用(=NFS等)

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         523     4194304   83  Linux Partition 1 does not end on cylinder boundary.
/dev/sda2             523        1045     4194304   83  Linux
/dev/sda3            1045       26576   205083080+  83  Linux
/dev/sda4           26577       60801   274912312+  83  Linux

Command (m for help): w
再起動
ext3でフォーマット
# mkfs -t ext3 /dev/sda4
mountする
# mount /dev/sda4 /export
# vi /etc/fstab
/dev/sda4   /export   ext3   defaults   1  1 を追加する

raw形式の論理ボリュームマネージャ仮想ディスクインフラストラクチャの作成方法

SRの汎用一意識別子(UUID)を確認
# xe sr-list type=lvm
uuid ( RO)                : 879c8892-7dae-c47a-2578-fbb417defac7
          name-label ( RW): Local storage
    name-description ( RW): 
                host ( RO): xenserver-ST120
                type ( RO): lvm
        content-type ( RO): user
raw形式のLVM仮想ディスクイメージ(VDI)を作成する
# xe vdi-create sm-config:type=raw sr-uuid=879c8892-7dae-c47a-2578-fbb417defac7 name-label="NFS LVM VDI" virtual-size=200GiB type=user
ディスクイメージ(VDI)が作成されているのを確認する
# lvscan
  inactive          '/dev/VG_XenStorage-879c8892-7dae-c47a-2578-fbb417defac7/LV-1170ff08-6c77-4bb5-b8bf-3802ae55b86a' [200.00 GB] inherit

LVMのLVを起動時にマウントする

# vi /etc/rc.sysinit
 # if [ -x /sbin/lvm.static ]; then
 #         action $"Setting up Logical Volume Management:" /sbin/lvm.static vgchange -a y --ignorelockingfailure
 # fi
↓コメントを外す
 if [ -x /sbin/lvm.static ]; then
          action $"Setting up Logical Volume Management:" /sbin/lvm.static vgchange -a y --ignorelockingfailure
  fi

ローカルディスクをNFSサーバーとして利用する

# vi /etc/exports
 /export XXX.XXX.XXX.XXX(rw,sync,no_root_squash,no_subtree_check)
NFS設定解除 [ポイント]
Dom0にはNFSサーバーがインストールされていますが、デフォルトではローカルからの接続以外は受け付けない。
portmap が "-l" オプション付で起動されているのが原因です。そこで下記の設定を行います。
# vi /etc/sysconfig/portmap

[修正前]
PMAP_ARGS=-l
[修正後]
PMAP_ARGS=""
# exportfs -r
# exportfs -v
/export XXX.XXX.XXX.XXX(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
NFSサービス設定
# /etc/init.d/portmap start
# /etc/init.d/nfslock start
# /etc/init.d/nfs start
自動起動設定
# chkconfig portmap on
# chkconfig nfslock on
# chkconfig nfs on

Dom0のSamba利用

# yum --enablerepo=base remove samba3*
# yum --enablerepo=base install samba
# /etc/init.d/smb start
# chkconfig smb on

Menu

メニュー

アプリケーション

アプリケーション

その他

【メニュー編集】

管理人/副管理人のみ編集できます