-->

Thursday, February 21, 2019

VMware Workstation Pro 15] 19. Configuring Shared Disks


Hello, guys. You will figure out how to configure shared disks in VMware Workstation Pro in this post. When you finish this practice, you will be able to create your test environment for testing cluster volume managers, cluster file systems, cluster server solutions, virtualization solutions and so on.



Please note that I don't explain about CLVM and GFS2 in this post. it is just an example of using a shared disk. I will post about these in the future.


Preparing the Test Environment

Please, create two virtual machines with the following spec:

Virtual machine name: CentOS601, CentOS602
Hardware compatibility: Workstation 15.x
Guest operating system: Linux/CentOS 6 64-bit
Processors: 1 Socket/2 Cores
Memory: 2048 MB
Network connection: VMnet5
I/O controller types: LSI Logic
Virtual disk type: SCSI
Disk: 20 GB
Display: Uncheck Accelerate 3D graphics

Install CentOS 6.6 on both virtual machines. You can download the relevant ISO files from the following website.

http://vault.centos.org/6.6/isos/x86_64/

When installing, select the set of software as shown below.




If the installation is finished, install VMware Tools. If you don't know how to install VMware Tools, refer to the following post.

https://sunguruitchannel01.blogspot.com/2019/02/vmware-workstation-pro-15-installing.html

Add the following to the /etc/hosts file.

192.168.5.21 centos601
192.168.5.22 centos602

Set the IP address.

CentOS601
CentOS602
  IP Address : 192.168.5.21/24
  Gateway : 192.168.5.254
  DNS : 1.1.1.1
  IP Address : 192.168.5.22/24
  Gateway : 192.168.5.254
  DNS : 1.1.1.1

Connect the CentOS-6.6-x86_64-bin-DVD1.iso file to the CDROM of the virtual machine and execute the following commands. Both virtual machines.

[root@centos601 ~]# cd /media/CentOS_6.6_Final/Packages/
[root@centos601 Packages]# rpm -ivh lvm2-cluster-2.02.111-2.el6.x86_64.rpm 
warning: lvm2-cluster-2.02.111-2.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:lvm2-cluster           ########################################### [100%]
[root@centos601 Packages]# rpm -ivh gfs2-utils-3.0.12.1-68.el6.x86_64.rpm 
warning: gfs2-utils-3.0.12.1-68.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:gfs2-utils             ########################################### [100%]
[root@centos601 Packages]# lvmconf --enable-cluster
[root@centos601 Packages]# shutdown -h now


Creating the virtual disk for sharing

Open File Explorer and create a folder for the shared disks. Then open the CMD window and execute the following commands for creating a virtual disk. You and my folder path may be different.

M:\>mkdir Shareddisks
M:\>cd Shareddisks
M:\Shareddisks>vmware-vdiskmanager -c -s 5GB -a lsilogic -t 4 CentOS6_CLVM_Disk01.vmdk

Please, select Editor virtual machine setting for adding the virtual disk you just created to the virtual machine.


click the Add button


Select Hard Disk and SCSI.


Select Use an existing virtual disk and click the Browse button. Then select the virtual disk file you just created. When you press the Finish button, a small window appears. Click the Keep Existing Format button.


Press the Advanced button for additional settings. Then set the device node and virtual disk mode.


Once you have finished setting up, you will see the added disk information as shown below.


Now edit the virtual machine's configuration file with the notepad. Just add the highlighted part.


If you finish, power on both virtual machines. Ignore the warning message.



Creating CLVM and GFS2 file system.

Copy the following and apply it to your virtual machines. To simplify testing, disable the firewall and SELinux features.

[root@centos601 ~]# vi a.sh


sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce permissive
service iptables stop
chkconfig iptables off 
chkconfig NetworkManager off
service NetworkManager stop
chkconfig cman on
chkconfig clvmd on
chkconfig gfs2 on
chkconfig acpid off

[root@centos601 ~]# bash a.sh
[root@centos601 ~]# vi /etc/cluster/cluster.conf
<cluster name="cl01" config_version="2">
   <cman two_node="1" expected_votes="1"/>
   <clusternodes>
     <clusternode name="centos601" nodeid="1">
         <fence>
         </fence>
     </clusternode>
     <clusternode name="centos602" nodeid="2">
         <fence>
         </fence>
     </clusternode>
   </clusternodes>
   <fencedevices>
   </fencedevices>
   <rm>
   </rm>
</cluster>

[root@centos601 ~]# shutdown -r now

Let's now create a cluster volume and a cluster file system.

[root@centos601 ~]# service cman status
cluster is running.

[root@centos601 ~]# service clvmd status
clvmd (pid  2104) is running...
Clustered Volume Groups: (none)
Active clustered Logical Volumes: (none)

[root@centos601 ~]# lsblk | grep disk
sda                         8:0    0   20G  0 disk 
sdb                         8:16   0    5G  0 disk 

[root@centos601 ~]# pvscan
  PV /dev/sda2   VG vg_os   lvm2 [19.51 GiB / 0    free]
  Total: 1 [19.51 GiB] / in use: 1 [19.51 GiB] / in no VG: 0 [0   ]

[root@centos601 ~]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created

[root@centos601 ~]# vgcreate vg_cl01 /dev/sdb
  Clustered volume group "vg_cl01" successfully created

[root@centos601 ~]# lvcreate -L 1G -n data01_vol vg_cl01
  Logical volume "data01_vol" created

[root@centos601 ~]# blkid /dev/vg_cl01/data01_vol 
[root@centos601 ~]# mkfs -t gfs2 -p lock_dlm -t cl01:data01 -j 2 /dev/vg_cl01/data01_vol
This will destroy any data on /dev/vg_cl01/data01_vol.
It appears to contain: symbolic link to `../dm-2'

Are you sure you want to proceed? [y/n] y

Device:                    /dev/vg_cl01/data01_vol
Blocksize:                 4096
Device Size                1.00 GB (262144 blocks)
Filesystem Size:           1.00 GB (262142 blocks)
Journals:                  2
Resource Groups:           4
Locking Protocol:          "lock_dlm"
Lock Table:                "cl01:data01"
UUID:                      800caabd-9d7e-3f7e-721c-9f4b307e312f

[root@centos601 ~]# blkid /dev/vg_cl01/data01_vol 
/dev/vg_cl01/data01_vol: LABEL="cl01:data01" UUID="800caabd-9d7e-3f7e-721c-9f4b307e312f" TYPE="gfs2" 

[root@centos602 ~]# pvscan
  PV /dev/sdb    VG vg_cl01   lvm2 [5.00 GiB / 4.00 GiB free]
  PV /dev/sda2   VG vg_os     lvm2 [19.51 GiB / 0    free]
  Total: 2 [24.50 GiB] / in use: 2 [24.50 GiB] / in no VG: 0 [0   ]

[root@centos602 ~]# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_cl01" using metadata type lvm2
  Found volume group "vg_os" using metadata type lvm2

[root@centos602 ~]# lvscan
  ACTIVE            '/dev/vg_cl01/data01_vol' [1.00 GiB] inherit
  ACTIVE            '/dev/vg_os/root_vol' [15.51 GiB] inherit
  ACTIVE            '/dev/vg_os/swap_vol' [4.00 GiB] inherit

[root@centos602 ~]# blkid /dev/vg_cl01/data01_vol
/dev/vg_cl01/data01_vol: LABEL="cl01:data01" UUID="800caabd-9d7e-3f7e-721c-9f4b307e312f" TYPE="gfs2" 

[root@centos601 ~]# mkdir /data01
[root@centos601 ~]# mount /dev/vg_cl01/data01_vol /data01
[root@centos601 ~]# sed -i '$ a\/dev/vg_cl01/data01_vol /data01 gfs2    defaults        0       0' /etc/fstab

In the sed command, press the Ctrl+v+Tab key at the same time to apply the tab.

[root@centos601 ~]# umount /data01
[root@centos601 ~]# mount /data01
[root@centos601 ~]# df -Ph /data01
Filesystem                      Size  Used Avail Use% Mounted on
/dev/mapper/vg_cl01-data01_vol  1.0G  259M  766M  26% /data01

[root@centos602 ~]# mkdir /data01
[root@centos602 ~]# mount /dev/vg_cl01/data01_vol /data01
[root@centos602 ~]# sed -i '$ a\/dev/vg_cl01/data01_vol /data01 gfs2    defaults        0       0' /etc/fstab
[root@centos602 ~]# touch /data01/file1

[root@centos601 ~]# ls -l /data01
total 4
-rw-r--r-- 1 root root 0 Feb 22 15:13 file1

Configuring Shared Disks is not easy. And if you use VMware Workstation for operating system testing or program development testing, you will rarely use this feature. However, if you are interested in or are planning to deal with virtualization and cluster server solutions, this feature will be quite useful for you.

You have acquired the skill to configure shared disks in VMware Workstation Pro. I encourage you to practice a few more times to become proficient. This feature will be needed to upgrade your IT skills. See you next. Thank you.



5 comments:

  1. Hi
    Many thanks for your tutorial.
    i would like to mount a cluster centOs with pacemaker. With your tutorial I can create a disk shared right? Then I must install cluster with pacemaker right?
    thanks!

    ReplyDelete
    Replies
    1. Sunguru It Channel 01: Vmware Workstation Pro 15] 19. Configuring Shared Disks >>>>> Download Now

      >>>>> Download Full

      Sunguru It Channel 01: Vmware Workstation Pro 15] 19. Configuring Shared Disks >>>>> Download LINK

      >>>>> Download Now

      Sunguru It Channel 01: Vmware Workstation Pro 15] 19. Configuring Shared Disks >>>>> Download Full

      >>>>> Download LINK g9

      Delete
  2. Free mobile and PC download games. Thousands of free . Download or play free online! . Here is the Exact Arcade Version of Dig Dug! please visit my sites.
    assassin's creed 1 torrent

    ReplyDelete
  3. Sunguru It Channel 01: Vmware Workstation Pro 15] 19. Configuring Shared Disks >>>>> Download Now

    >>>>> Download Full

    Sunguru It Channel 01: Vmware Workstation Pro 15] 19. Configuring Shared Disks >>>>> Download LINK

    >>>>> Download Now

    Sunguru It Channel 01: Vmware Workstation Pro 15] 19. Configuring Shared Disks >>>>> Download Full

    >>>>> Download LINK FZ

    ReplyDelete