OpenVZ Forum


Home » General » Support » /proc/swaps needed for Oracle 11g RAC
Here is my procedure to create virutal disk for CT [message #35885 is a reply to message #35877] Wed, 29 April 2009 09:41 Go to previous messageGo to previous message
bpolarsk is currently offline  bpolarsk
Messages: 2
Registered: April 2009
Junior Member
I can creates a virtual shared disk, but did not tested if it works for RAC :


On the Vz Server (Ip host vz 192.168.89.7):

yum whatprovides tgtd
--> scsi-target-utils.x86_64

yum install scsi-target-utils.x86_64 # to be found on the Centos repository, not on the RedHat one.
yum install iscsi-initiator-utils.x86_64 # also needed

#Start isci daemon:
/etc/init.d/iscsi start
--> Setting up iSCSI targets: iscsiadm: No records found! [ OK ]

# create an empty file to be the virtual disk:
dd if=/dev/zero of=/vz/shared_disk/shared_disk01.vz bs=1M count=512
# create a iscsi group
tgtadm --lld iscsi --op new --mode target --tid 1 -T shared_disk01.vz # this is group name
# a a disk to this iscsi group
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /vz/shared_disk/shared_disk01.vz
tgtadm --lld iscsi --op bind --mode target --tid 1 -I 192.168.89.7
# show what we have done:
tgtadm --lld iscsi --op show --mode target
iscsiadm --mode discovery --type sendtargets --portal 192.168.89.7
--> # 192.168.89.7:3260,1 shared_disk01.vz

iscsiadm --mode node --targetname shared_disk01.vz --portal 192.168.89.7:3260 --login
--> Logging in to [iface: default, target: shared_disk01.vz, portal: 192.168.89.7,3260]
--> Login to [iface: default, target: shared_disk01.vz, portal: 192.168.89.7,3260]: successful

[bdglo0001vz]:/vz/shared_disk> fdisk -l
--> Disk /dev/cciss/c0d0: 73.3 GB, 73372631040 bytes
--> 255 heads, 63 sectors/track, 8920 cylinders
--> Units = cylinders of 16065 * 512 = 8225280 bytes
-->
--> Device Boot Start End Blocks Id System
--> /dev/cciss/c0d0p1 * 1 19 152586 83 Linux
--> /dev/cciss/c0d0p2 20 1294 10241437+ 82 Linux swap / Solaris
--> /dev/cciss/c0d0p3 1295 8920 61255845 8e Linux LVM
-->
--> Disk /dev/sda: 20 MB, 20971520 bytes
--> 1 heads, 40 sectors/track, 1024 cylinders
--> Units = cylinders of 40 * 512 = 20480 bytes
--> Disk /dev/sda doesn't contain a valid partition table

fdsik /dev/sda # create here a partition primary on the whole disk, then quit
partprobe /dev/sda
mke2fs /dev/sda1


# Now I mount this Virtual disk on a directory on the node, then I export this directory into 2 Container
# Fist mount the Virt. Disk on the VZ host:
mount /dev/sda1 /vz/shared_disk/mnt1
# Next shared this mount with both target CT 140001 and CT 140003:

mount --bind /vz/shared_disk/mnt1 /vz/root/140001/app
mount --bind /vz/shared_disk/mnt1 /vz/root/140003/app

#On container 140001:
vzctl enter 140001
--> entered into CT 140001
--> [root@ap01 /]# df
--> Filesystem 1K-blocks Used Available Use% Mounted on
--> simfs 20314748 9902384 9363788 52% /
--> /dev/sda1 19807 173 18611 1% /app
--> [root@ap01 /]# ls -l app
--> total 13
--> -rw-r--r-- 1 root root 12 Apr 29 11:25 hello
--> drwx------ 2 root root 12288 Apr 29 11:00 lost+found

#On container 140003:
vzctl enter 140003
--> entered into CT 140003
--> [root@ap03 app]# df
--> Filesystem 1K-blocks Used Available Use% Mounted on
--> simfs 20314748 9902384 9363788 52% /
--> /dev/sda1 19807 173 18611 1% /app
--> [root@ap03 app]# ls -l
--> total 13
--> -rw-r--r-- 1 root root 12 Apr 29 11:25 hello
--> drwx------ 2 root root 12288 Apr 29 11:00 lost+found


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: caos nsa linux template
Next Topic: Adding New IP Range
Goto Forum:
  


Current Time: Sat Sep 06 21:26:44 GMT 2025

Total time taken to generate the page: 0.11417 seconds