Use VMware Virtual Disk Manager to create a shared Disk

Source: Internet
Author: User

I recently ran a VMware + Linux + Oracle10g RAC experiment and encountered a shared disk problem. I will summarize this as a topic and share my experiment experience.

 

The first thing to note is that this experiment has not reached the state of disk sharing I want. It is mainly because the shared disk is not synchronized with the data of the shared disk on the two nodes.

 

The shared disk is modified on node 1 and cannot be immediately reflected on node 2 (after restart.

 

I. first introduce how to use VMware Virtual Disk Manager
Usage:Vmware-vdiskmanager.exe options <disk-name >|< Mount-point>
Offline disk manipulation Utility
Options:
-C: Create disk; need to specify other create options to create a virtual disk, which must be used together with additional options (-a,-S, and-T ).

-D: Defragment the specified virtual disk fragment. Only the increasing virtual disks can be organized, and pre-allocated Virtual Disks cannot be sorted.

-K: Shrink the specified virtual disk compression the specified virtual disk can only shrink the disk that can be increased, and cannot shrink the virtual disk with virtual machine snapshots

Disk

-N <source-disk>: Rename the specified virtual disk; Need)
Specify destination disk-name

-P: Prepare the mounted Virtual Disk specified
The drive-letter for shrinking
Prepare to compress the disk. If the virtual disk is divided into multiple partitions, each partition must be prepared separately. Partition (such as C: Or d :)

You must use the VMware diskmount tool for ing. After you prepare for the partition, unmap the partition. Continue to map other Virtual Disk

For each partition, prepare to compress the disk until all partitions on the Virtual Disk are ready. You can only use

VMware diskmount maps a partition of a virtual disk. You can only prepare for shrinking the partition of the virtual disk on the Windows host.

-Q: Do not log messages prohibits virtual disk management programs from writing logs. If you allow logging, the logs will be generated by the virtual disk management program.

And storage. After the Virtual Disk Manager program runs, the log name and storage location will appear in the command line or terminal.

-R <source-disk>: Convert the specified disk; need to specify indicates the type of the converted disk.
Destination disk-type
Example: vmware-vdiskmanager-r sourcedisk. vmdk-T 0 targetdisk. vmdk
This command converts a disk from its original pre-allocation mode to a growth Virtual Disk contained in a single file. This virtual disk space will not

Pre-allocated, the Virtual Disk tool will reclaim some disk space in the virtual disk, and only occupy the data in the virtual disk space.

-X <New-capacity>: Expand the disk to the specified capacity extends the disk to a specified size

 

Additional options for creating and converting a disk: additional options for create and convert
-A <adapter>: (For use with-C only) adapter type (IDE, buslogic or lsilogic) specifies the disk Adapter

-S <size>: Capacity of the Virtual Disk specifies the disk size

-T <disk-type>: Disk type ID: Specifies the disk type, which can be used with the disk adapter.

Disk types:
0: single growable Virtual Disk: Creates a scalable virtual disk that is included in a single virtual file.
1: growable Virtual Disk split in 2 GB files create a scalable Virtual Disk split into 2 GB for each file
2: preallocated Virtual Disk creates a pre-allocated virtual disk that is included in a single Virtual File
3: preallocated Virtual Disk split in 2 GB files create a pre-allocated Virtual Disk split into 2 GB for each file
The capacity can be specified in sectors, kb, MB or GB. Capacity Unit
The acceptable ranges:
IDE adapter: [100.0 MB, 950.0 GB] disk size limit, which is related to the adapter type. Both the IDE and SCSI adapters have a minimum of 100 MB.

, Maximum 950 GB.
SCSI adapter: [100.0 MB, 950.0 GB]

 

For example, describe its usage:
Vmware-vdiskmanager.exe-C-s 850 mb-A ide-T 0 myidedisk. vmdk

Create a single-grown disk named myidedisk with a size of 850 mb and an adapter type of IDE

Ex 2: vmware-vdiskmanager.exe-D mydisk. vmdk

Sort disk fragments of mydisk

Ex 3: vmware-vdiskmanager.exe-r sourcedisk. vmdk-T 0 destinationdisk. vmdk

Ex 4: vmware-vdiskmanager.exe-x 36 GB mydisk. vmdk

Extend the size of mydisk to 36 GB.

Vmware-vdiskmanager.exe-N sourcename. vmdk destinationname. vmdk

Rename

Ex 6: vmware-vdiskmanager.exe-K mydisk. vmdk

Compress the disk and a temporary file will be generated when the disk is reduced. In fact, it is the compressed Virtual Disk file, which will replace the original Virtual Disk File.

Ex 7: vmware-vdiskmanager.exe-P <Mount-point> prepare for shrinking the Virtual Disk
(A virtual disk first needs to be mounted at <Mount-point>)

 

Ii. Create a shared Disk

In the virtual machine software installation directory, there is a vmware-vdiskmanager.exe file, copy it to the shared cabinet directory, and create a shared Disk
F:/EXP> vmware-vdiskmanager.exe-C-S 100 MB-A lsilogic-T 2 OCR. vmdk
F:/EXP> vmware-vdiskmanager.exe-C-S 100 MB-A lsilogic-T 2 vote. vmdk
[You may need to copy vmcryptolib. dll]
After the file is created, the directory contains four new files.
If "-T 0" (how much space is used), no flat. vmdk file is shown in:

3. Configure virtual machines
On the Virtual Machine page, select "Edit Virtual Machine Settings" to add a hard disk, and select "Use a existing virtual disk" to add it separately. Note the following:

As shown in:

Add the following code to the. vmx file:

Disklib. datacachemaxsize = "0"
Disklib. datachemaxreadaheadsize = "0"
Disklib. datacacheminreadaheadsize = "0"
Disklib. datacachepagesize = "4096"
Disklib. maxunsyncedwrites = "0"

Disk. Locking = "false" // make sure the system does not lock the disk, so that both nodes can mount the disk to achieve sharing.
Scsi1: 1. devicetype = "disk"
Scsi1: 2. devicetype = "disk"
Scsi1: 1. sharedbus = "virtual"
Scsi1: 2. sharedbus = "virtual"
Scsi0: 1. Shared = "true"
Scsi0: 2. Shared = "true"

 

4. Disk partitioning

You can use fdisk-L to check the status of all disks. Before there is no partition, you cannot see the two disks we just added (use fdisk-L to view the partition information ). Use commands

Fdisk/dev/SDB (similar to another one) for partitioning, as shown below:

Save and restart the VM... Then, run fdisk-L to view the partition information. Then, sdb1 is displayed in the partition information.

 

5. Format
Use the mkfs command to format sda4.
Mkfs. ext3/dev/sdb1
Format/dev/sdb1 to ext3.

 

Vi. Mounting
Create a folder mkdir/mnt/test
Mount sdb1 to/mnt/test
Mount/dev/sdb1/mnt/test
Run the DF-H command to view the result:

At this time, we found that/dev/sdb1 has been mounted to the/mnt/test directory.

VII. Verification and sharing

Create a file on node 1: # Touch/mnt/test/first.txt

On Node 2, perform the "virtual machine configuration-add shared disk", "partition", and "Mount" operations (no formatting is required because

The disk has been formatted on node 1)

Ls/mnt/test. For example, you can find the first.txt created on node 1 under Node 2.

Figure 1:

Figure 2:

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.