[vdsm] Q on createVolume(..) filesize.

2012-07-12 Thread Deepak C Shetty

Hello,
I am working on a VDSM standalone script that is using PosixFS 
inteface to mount gluster volume

 trying to create a volume (file) inside the storage domain.

Snip of the code is below...

==
sizeGiB = 4

tid = vdsOK(s.createVolume(sdUUID, spUUID, imgUUID, sizeGiB,
   RAW_FORMAT, PREALLOCATED_VOL, LEAF_VOL,
   volUUID, glustervol,
   BLANK_UUID, BLANK_UUID))['uuid']
waitTask(s, tid)
==

But the file size created is not 4G, its 8K as seen below...

qemu-img info 
/rhev/data-center/mnt/kvmfs01-hs22:dpkvol/f0443ec4-3c94-49c9-a239-797562ee4926/images/073b3309-e4cd-4b6c-978e-5744a9afb8b7/c8c4f92e-818d-433a-b013-b0060cd7cc87
image: 
/rhev/data-center/mnt/kvmfs01-hs22:dpkvol/f0443ec4-3c94-49c9-a239-797562ee4926/images/073b3309-e4cd-4b6c-978e-5744a9afb8b7/c8c4f92e-818d-433a-b013-b0060cd7cc87

file format: raw
virtual size: 2.0K (2048 bytes)
disk size: 8.0K

It should have created a raw file of size 4G, but its not.
Wondering if the sizeGiB argument is not in GB but somethign else ?


thanx,
deepak


___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/vdsm-devel


Re: [vdsm] Q on createVolume(..) filesize.

2012-07-12 Thread Deepak C Shetty

On 07/12/2012 06:32 PM, Lee Yarwood wrote:

On 07/12/2012 01:25 PM, Deepak C Shetty wrote:

Hello,
 I am working on a VDSM standalone script that is using PosixFS
inteface to mount gluster volume
  trying to create a volume (file) inside the storage domain.

Snip of the code is below...

==
sizeGiB = 4

tid = vdsOK(s.createVolume(sdUUID, spUUID, imgUUID, sizeGiB,
RAW_FORMAT, PREALLOCATED_VOL, LEAF_VOL,
volUUID, glustervol,
BLANK_UUID, BLANK_UUID))['uuid']
waitTask(s, tid)
==

But the file size created is not 4G, its 8K as seen below...

qemu-img info
/rhev/data-center/mnt/kvmfs01-hs22:dpkvol/f0443ec4-3c94-49c9-a239-797562ee4926/images/073b3309-e4cd-4b6c-978e-5744a9afb8b7/c8c4f92e-818d-433a-b013-b0060cd7cc87

image:
/rhev/data-center/mnt/kvmfs01-hs22:dpkvol/f0443ec4-3c94-49c9-a239-797562ee4926/images/073b3309-e4cd-4b6c-978e-5744a9afb8b7/c8c4f92e-818d-433a-b013-b0060cd7cc87

file format: raw
virtual size: 2.0K (2048 bytes)
disk size: 8.0K

It should have created a raw file of size 4G, but its not.
Wondering if the sizeGiB argument is not in GB but somethign else ?

Isn't this argument actually the number of sectors?

vdsm/storage/fileVolume.py

119 def create(cls, repoPath, sdUUID, imgUUID, size, volFormat,
preallocate,
120diskType, volUUID, desc, srcImgUUID, srcVolUUID):
121 
122 Create a new volume with given size or snapshot
123 'size' - in sectors
124 'volFormat' - volume format COW / RAW
125 'preallocate' - Preallocate / Sparse
126 'diskType' - enum (API.Image.DiskTypes)
127 'srcImgUUID' - source image UUID
128 'srcVolUUID' - source volume UUID
129 

Lee


Thanks, i realised it after see the 'dd' cmd vdsm invokes to 
preallocate, 'bs' is not specified, so it defaults to 512 blksize


___
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/vdsm-devel