-   Linux - Virtualization and Cloud (
-   -   iscsi growing disk qcow2? (

st_disk 03-14-2012 04:23 PM

iscsi growing disk qcow2?
I am attempting to setup an ISCSI target using the qcow2 image format. It does not appear that tgtd supports the qcow2 format. The disk size will show zero or give a 250kb or so disk size. My question is what is the best way to setup a virtual disk using iscsi? For example I would like to create an ISCSI 1TB virtual disk. The disk would not consume 1TB but would have 1TB available. As data is added to it, the actual file size would grow.

Micro$oft has the ability to use VHD files to do this.I can easily setup a dd image file that consumes the entire size specified and ISCSI will work fine. But filling up an entire 1TB drive in my application is not practical. Any help would be appreciated.

jefro 03-15-2012 05:09 PM

This should work and I feel like I have seen the how to on it not too long ago.

In a very basic sense it would be the same as a virtual image on a scsi drive. We know that work. The issue here is that you may not have iscsi support in the loading. What you are trying do is boot or load some OS or virtual machine client, correct?

I wish I could remember where I saw that.

See this for some ideas to start.

I get the idea it was on a gpxe or ipxe site.

dyasny 03-16-2012 06:19 AM

Sparse fuiles can be used with raw files, it doesn't have to be qcow2

jefro 03-16-2012 04:16 PM

I may have misunderstood this. Do you want to use the compressed virtual hard drive without a virtual machine?

st_disk 03-19-2012 04:29 PM

Correct. I am looking for disk storage and not to boot an OS. The sparse file idea works. However, I am looking to use the Fuse file system to store the virtual drive. Sparse files do not show up correctly on a fuse file system. I am looking to mount a folder to Amazon or Rackspace using fuse, and then store a virtual disk inside the folder. ISCSI would use this virtual disk as storage and the file would grow as space is needed. I know performance would not be great but it would work for my needs. QCow2 is not necessarily a requirement as long as I do not need to allocate the full amount of space to the storage.

ISCSI > virtual disk > stored on a cloud Rackspace or AWS.

Basically an ISCSI drive that has 1TB of storage housed in a cloud. That grows as files are stored in it.

Thanks for the responses. If anyone has any further feedback that would be great. I will continue trying to pursue the idea and will post if I figure it out. Thanks!

dyasny 03-19-2012 05:02 PM

why iSCSI? It is not a protocol to be used over WAN, or even over a VPN link - very heavy and noisy. I would just use sftp

Olivianerden 03-27-2012 05:53 AM

I'm with dyasny, use sftp
Good luck

jefro 03-27-2012 03:41 PM

And I don't know of a way to grow a real partition.

dyasny 03-27-2012 05:15 PM


Originally Posted by jefro (Post 4638003)
And I don't know of a way to grow a real partition.

man parted
man resize2fs

jefro 03-27-2012 07:46 PM

I think he wanted to grow it as needed in a transparent manner as is the case with a qcow2 image.

dyasny 03-28-2012 09:17 AM


Originally Posted by jefro (Post 4638177)
I think he wanted to grow it as needed in a transparent manner as is the case with a qcow2 image.

qcow2 is not a partition, and it cannot grow on it's own - something has to extend it (whether it's the underlying FS extending a sparse file, or a monitoring system that periodically runs lvextend).

And in any case, partitions can grow, in online mode, without interruption and having to remount, both in Windows and in Linux.

jefro 03-28-2012 03:53 PM

I'd like to know about that then. I have never heard of a transparent method to grow a partition as the need for it exists as is the case with qcow2 virtual drives.

I was pretty sure that qcow2 isn't a partition but thanks for pointing that out.

dyasny, you have not been following the post. We have all known all this from the beginning. The OP wanted some method to replicate the way a qcow2 disk works on a real system.

dyasny 03-29-2012 06:11 AM

but that's the thing - qcow2 provides a block device. Give your machine access to a larger LUN (or increase the LUN size - most SANs allow you to do that) and you've got a larger block device, but the partition on it will be the same size. Expand a qcow2 or raw file, while a VM is running, and it'll also have a larger block device attached, but the partitions will not change.
All I'm saying is that this behaviour is the same on all systems, and you can expand the partition's size live, using the OS tools, without powering down your machine.

jefro 03-29-2012 04:11 PM

The OP wanted to install a real linux system to a iscsi, not a virtual machine.

dyasny 03-30-2012 06:25 AM

This conversation had strayed away from the OP's question long ago, when you started claiming partitions could not be resized

All times are GMT -5. The time now is 08:14 AM.