본문 바로가기
프로그래밍/XenServer

XenServer 로컬 스토리지 추가

by 완소루피 2017. 10. 19.
728x90
반응형
XenServer를 설치할 때 특정 디스크를 선택하여 O/S를 선택한다. 
추가 디스크 적용은 터미널에서 아래와 같이 추가하여 사용한다.

[ XenServer 에서 진행 ]

# fdisk -l

Disk /dev/sda: 1000.1 GB, 1000171331584 bytes
256 heads, 63 sectors/track, 121122 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1      121123   976729815+  ee  EFI GPT

Disk /dev/sdb: 1000.1 GB, 1000171331584 bytes
255 heads, 63 sectors/track, 121597 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121598   976728064   83  Linux

LVM을 생성하기 위하여  UUID를 확인한다.
# xe host-list
uuid ( RO)                : 9e5e2a02-2305-41cf-b74e-2850ebc85d61
          name-label ( RW): xenserver
    name-description ( RW): Default install of XenServer

위에서 확인한 UUID,name-label, device(마운트되어있는 디스크 디바이스)를 선택하여 생성한다.
# xe sr-create host-uuid=9e5e2a02-2305-41cf-b74e-2850ebc85d61 content-type=user name-label="Local storage2" shared=false device-config:device=/dev/sdb type=lvm

정상적으로 표시가되는지 확인
# xe sr-list
uuid ( RO)                : 4b7cbc92-c748-0b47-54d6-c2aea737c116
          name-label ( RW): Local storage
    name-description ( RW): 
                host ( RO): xenserver
                type ( RO): lvm
        content-type ( RO): user
uuid ( RO)                : 3f952466-1537-0d91-6f13-c832c6ec454a
          name-label ( RW): Local storage2
    name-description ( RW): 
                host ( RO): xenserver
                type ( RO): lvm
        content-type ( RO): user

최종적으로 아래와 같이 XenCenter에서 확인할 수 있다.
O/S설치 및 Template설치 시 해당 디스크를 선택하여 용량을 할당하면 된다.


[ Guest Host에서 진행 ]
새로운 디스크를 포맷하고 적용시킴

먼저 XenCenter에서 신규 스토리지를 할당하고 진행한다.
아래 디바이스(/dev/xvdb)명은 VM이 모두 동일하다.

# fdisk /dev/xvdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd1978864.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-117487, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-117487, default 117487): 
Using default value 117487

Command (m for help): p

Disk /dev/xvdb: 966.4 GB, 966367641600 bytes
255 heads, 63 sectors/track, 117487 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd1978864

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               1      117487   943714296   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
# mkfs.ext4 /dev/xvdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
58982400 inodes, 235928574 blocks
11796428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7200 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
102400000, 214990848

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
# mount /dev/xvdb1 /Data
# mount -a
# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   50G  768M   46G   2% /
tmpfs                         7.8G     0  7.8G   0% /dev/shm
/dev/xvda1                    485M   33M  427M   8% /boot
/dev/mapper/VolGroup-lv_home   45G  180M   43G   1% /home
/dev/xvdb1                    886G  200M  841G   1% /Data


728x90
반응형