Skip to contentSkip to conversation

Crash: When Host HDD is full

Qemu-devel Alexey Eremenko 8 participants 14 messages Jul 11, 2007 – Jul 19, 2007

lore
Share & tools
lore
#0 lore raw

Problem 1:
When Host HDD is full, all guests simply crash. Tried with dynamically growing .VMDK hard disk.

It shouldn't happen. For example, both VirtualPC and VirtualBox pause all VMs, and gray their displays when something like that happens.

Host: Fedora 7, 64-bit, Qemu 0.9, AMD Opteron.

Problem 2: Where is Qemu Bugzilla ?

Signature · 1 line
-Alexey Eremenko "Technologov"
#1 lore raw
Quoted 6 lines · On Wednesday 11 July 2007 08:19:48 Alexey Eremenko wrote:

Problem 1:
When Host HDD is full, all guests simply crash. Tried with dynamically growing .VMDK hard disk.

It shouldn't happen. For example, both VirtualPC and VirtualBox pause all VMs, and gray their displays when something like that happens.

IMO, it's a non-issue; you probably shouldn't be letting your filesystems to become full in the first place, much less running VMs on it. Besides, most filesystems reserve some space for the superuser, now unless there's a cross-platform way to figure out just how much space that is, you'd still be getting errors despite having 5~10% of the filesystem technically free.

#2 lore raw
Quoted 11 lines · Mike Swanson
Quoted 7 lines · On Wednesday 11 July 2007 08:19:48 Alexey Eremenko wrote:

Problem 1:
When Host HDD is full, all guests simply crash. Tried with dynamically growing .VMDK hard disk.

It shouldn't happen. For example, both VirtualPC and VirtualBox pause all VMs, and gray their displays when something like that happens.

IMO, it's a non-issue; you probably shouldn't be letting your filesystems to become full in the first place, much less running VMs on it.

Well, he shouldn't, but neither should qemu crash or corrupt data.

Quoted 3 lines

Besides, most filesystems reserve some space for the superuser, now unless there's a cross-platform way to figure out just how much space that is, you'd still be getting errors despite having 5~10% of the filesystem technically free.

Qemu might freeze the guest when it gets -ENOSPC, and say, retry every second or wait for user input on the monitor.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
Quoted 8 lines
Quoted 5 lines

Besides, most
filesystems reserve some space for the superuser, now unless there's a cross-platform way to figure out just how much space that is, you'd still be getting errors despite having 5~10% of the filesystem technically free.

Qemu might freeze the guest when it gets -ENOSPC, and say, retry every second or wait for user input on the monitor.

Better would IMHO be to report an IO error to the guest and allow that to decide what to do. If you're bothered about robustness and reliability then arbitrarily stopping the guest is not acceptable behaviour. There's no guarantee that space will become available in a finite timeframe.

Paul

#7 lore raw
In reply to Avi Kivity
Quoted 7 lines · Avi Kivity
Quoted 6 lines · Mike Swanson
Quoted 4 lines · On Wednesday 11 July 2007 08:19:48 Alexey Eremenko wrote:

Problem 1:
When Host HDD is full, all guests simply crash. Tried with dynamically growing .VMDK hard disk.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

It shouldn't happen. For example, both VirtualPC and VirtualBox pause all VMs, and gray their displays when something like that happens.

IMO, it's a non-issue; you probably shouldn't be letting your filesystems to become full in the first place, much less running VMs on it.

Well, he shouldn't, but neither should qemu crash or corrupt data.

It should be propagating any IO errors in the host back up to the guest OS as IDE errors. The guest OS will see these and (in the case of Linux) take the filesystem offline. There should be no crash or data corruption. While any outstanding writes will not have been flushed with any reasonable filesystem it will recover upon reboot, either by fsck, or trivially recovering the journal & maintaining filesystem integrity.

Potentially ENOSPC could be handled as a special case by pausing the guest, but in general I/O errors can be propagated back to guest for handling (even if the guest merely takes things ofline).

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#4 lore raw
In reply to Paul Brook
Quoted 6 lines · Paul Brook
Quoted 6 lines
Quoted 6 lines

Besides, most
filesystems reserve some space for the superuser, now unless there's a cross-platform way to figure out just how much space that is, you'd still be getting errors despite having 5~10% of the filesystem technically free.

Quoted 6 lines
Quoted 3 lines

Qemu might freeze the guest when it gets -ENOSPC, and say, retry every second or wait for user input on the monitor.

Better would IMHO be to report an IO error to the guest and allow that to decide what to do. If you're bothered about robustness and reliability then arbitrarily stopping the guest is not acceptable behaviour. There's no guarantee that space will become available in a finite timeframe.

I've considered that, and I'm not sure. You will likely get a storm of I/O errors on ENOSPC; with several ways for disaster to strike:
- the guest doesn't handle I/O errors well, and keeps writing. some of the writes are overwrites so they hit the disk and data is corrupted
- the guest decides the disk is bad because it has too many errors and initiates some recovery procedure

Stopping the guest at least guarantees nothing unexpected happens. If it's part of a managed solution we can output a message to the monitor which eventually finds its way to the operator.

Signature · 1 line
error compiling committee.c: too many arguments to function
#8 lore raw
In reply to Daniel P. Berrange
Quoted 20 lines · Daniel P. Berrange
Quoted 9 lines · Avi Kivity
Quoted 7 lines · Mike Swanson
Quoted 4 lines · On Wednesday 11 July 2007 08:19:48 Alexey Eremenko wrote:

Problem 1:
When Host HDD is full, all guests simply crash. Tried with dynamically growing .VMDK hard disk.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

It shouldn't happen. For example, both VirtualPC and VirtualBox pause all VMs, and gray their displays when something like that happens.

IMO, it's a non-issue; you probably shouldn't be letting your filesystems to become full in the first place, much less running VMs on it.

Well, he shouldn't, but neither should qemu crash or corrupt data.

Quoted 9 lines

It should be propagating any IO errors in the host back up to the guest
OS as IDE errors. The guest OS will see these and (in the case of Linux)
take the filesystem offline. There should be no crash or data corruption.
While any outstanding writes will not have been flushed with any reasonable
filesystem it will recover upon reboot, either by fsck, or trivially recovering the journal & maintaining filesystem integrity.

Potentially ENOSPC could be handled as a special case by pausing the guest, but in general I/O errors can be propagated back to guest for handling (even if the guest merely takes things ofline).

I agree about general I/O errors. However ENOSPC cannot happen for disks and should not be converted into an I/O error.

Signature · 1 line
error compiling committee.c: too many arguments to function
#5 lore raw
In reply to Avi Kivity
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Qemu might freeze the guest when it gets -ENOSPC, and say, retry every second or wait for user input on the monitor.

Better would IMHO be to report an IO error to the guest and allow that to decide what to do. If you're bothered about robustness and reliability then arbitrarily stopping the guest is not acceptable behaviour. There's no guarantee that space will become available in a finite timeframe.

Quoted 4 lines

I've considered that, and I'm not sure. You will likely get a storm of I/O errors on ENOSPC; with several ways for disaster to strike:
- the guest doesn't handle I/O errors well, and keeps writing. some of the writes are overwrites so they hit the disk and data is corrupted

If an guest OS ignores IO write errors it's just plain broken.

Quoted 6 lines

- the guest decides the disk is bad because it has too many errors and initiates some recovery procedure

Stopping the guest at least guarantees nothing unexpected happens. If it's part of a managed solution we can output a message to the monitor which eventually finds its way to the operator.

I don't buy this argument. If you don't want "unexpected" things to happen then the solution is simple: Make sure you never run out of disk space.

The fact is that your (virtual) disk *is* broken at this point. The guest OS is in a much better position to decide on an appropriate course of action, either by retrying or some other recovery mechanism.

There are various error contitions that could be used, for example write-protect.

Paul

#6 lore raw
Quoted 8 lines · Paul Brook
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Qemu might freeze the guest when it gets -ENOSPC, and say, retry every second or wait for user input on the monitor.

Better would IMHO be to report an IO error to the guest and allow that to decide what to do. If you're bothered about robustness and reliability then arbitrarily stopping the guest is not acceptable behaviour. There's no guarantee that space will become available in a finite timeframe.

Quoted 9 lines
Quoted 5 lines

I've considered that, and I'm not sure. You will likely get a storm of I/O errors on ENOSPC; with several ways for disaster to strike:
- the guest doesn't handle I/O errors well, and keeps writing. some of the writes are overwrites so they hit the disk and data is corrupted

If an guest OS ignores IO write errors it's just plain broken.

Linux 2.4 ignores IO write errors under certain conditions. Yes, it's broken. But you're making the user suffer for this brokenness even if the only thing wrong is a temporary shortage of disk space.

Quoted 9 lines
Quoted 6 lines

- the guest decides the disk is bad because it has too many errors and initiates some recovery procedure

Stopping the guest at least guarantees nothing unexpected happens. If it's part of a managed solution we can output a message to the monitor which eventually finds its way to the operator.

I don't buy this argument. If you don't want "unexpected" things to happen then the solution is simple: Make sure you never run out of disk space.

That's unrealistic, at least for the casual user running qemu. A managed solution can probably work around this.

Qemu should be more user friendly.

Quoted 3 lines

The fact is that your (virtual) disk *is* broken at this point. The guest OS is in a much better position to decide on an appropriate course of action, either by retrying or some other recovery mechanism.

I don't see why it is broken. The disk contents have not changed since after the last successful write. Once you free some space you can continue writing.

Note that a recovery mechanism that involves writing will likely fail as well, possibly corrupting the disk in the process.

Quoted 2 lines

There are various error contitions that could be used, for example write-protect.

The guest would most likely be surprised at getting a write-protect error on its hard disk, and then the disk *would* be broken.

Signature · 1 line
error compiling committee.c: too many arguments to function
#9 lore raw
In reply to Daniel P. Berrange
Quoted 12 lines · Daniel P. Berrange
Quoted 11 lines · Avi Kivity
Quoted 10 lines · Mike Swanson
Quoted 7 lines · On Wednesday 11 July 2007 08:19:48 Alexey Eremenko wrote:

Problem 1:
When Host HDD is full, all guests simply crash. Tried with dynamically growing .VMDK hard disk.

It shouldn't happen. For example, both VirtualPC and VirtualBox pause all VMs, and gray their displays when something like that happens.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

IMO, it's a non-issue; you probably shouldn't be letting your filesystems to become full in the first place, much less running VMs on it.

Well, he shouldn't, but neither should qemu crash or corrupt data.

It should be propagating any IO errors in the host back up to the guest OS as IDE errors.

Here's a patch attempting to do that which I posted back when I was really annoyed at almost losing my data because of QEMU not propagating the errors:
http://lists.gnu.org/archive/html/qemu-devel/2005-12/msg00275.html . I agree that this should be the correct behavior but there was no agreement over this when it was discussed on IRC. (I don't know if the patch was correct though, it was a bit of black magic for me at the time)

Cheers,
Andrew

#10 lore raw

Pause VMs is the only realistic option. This is the correct option, because it ensures that guest is still alive.
Other options might crash the guest, like Windows BSOD. Worse yet is that guest may think that it's hard disk is bad, and will start marking it's sectors as bad-blocks.

When the VM is paused, the user may take action to free some disk space and unpause guest manually.

Signature · 1 line
-Alexey Eremenko "Technologov"
#11 lore raw
Quoted 1 line

From a usability perspective, I also would expect this to be the correct

behaviour. Non-technical users using, say, Windows (in full-screen mode) on a GNU/Linux desktop need to know that their HDD is full and they must free up space - not have the guest complain about cryptic HDD errors and failed writes (assuming the guest OS can even be trusted to do this).

Pausing the VM and notifying the user of no free host storage space is also the same behaviour as other virtualization products, so this might already be the expected behaviour from the user's POV.

At the very least, I feel a switch to enable this behaviour would be appropriate.

-Adam

Quoted 9 lines · Alexey Eremenko

Pause VMs is the only realistic option. This is the correct option, because it ensures that guest is still alive.
Other options might crash the guest, like Windows BSOD. Worse yet is
that guest may think that it's hard disk is bad, and will start marking it's sectors as bad-blocks.

When the VM is paused, the user may take action to free some disk space and unpause guest manually.

#12 lore raw

Am 19.07.2007 um 09:25 schrieb Adam Bolte:

Quoted 7 lines
Quoted 1 line

From a usability perspective, I also would expect this to be the

correct
behaviour. Non-technical users using, say, Windows (in full-screen mode) on a GNU/Linux desktop need to know that their HDD is full and they must free up space - not have the guest complain about cryptic HDD errors and failed writes (assuming the guest OS can even be trusted to do this).

Quoted 6 lines

Pausing the VM and notifying the user of no free host storage space is also the same behaviour as other virtualization products, so this might already be the expected behaviour from the user's POV.

At the very least, I feel a switch to enable this behaviour would be appropriate.

Having developed applications for memory-limited devices I agree that an application must handle any cases, whether assumed common or not, including out-of-memory situations. So qemu should always detect this and handle it in some way.

Regarding the user's point of view described above, I concur that a switch would be a good compromise. However given that someone using CVS head is likely to read the mailing list and all other users upgrading should read the release notes, this option should be the default or otherwise exactly those users the feature is targeted at will not use the switch! It's also more frontend-friendly not needing an additional switch for mainstream users.

Andreas

#13 lore raw
Quoted 9 lines · Andreas Färber

Regarding the user's point of view described above, I concur that a switch would be a good compromise. However given that someone using CVS head is likely to read the mailing list and all other users upgrading should read the release notes, this option should be the default or otherwise exactly those users the feature is targeted at will not use the switch! It's also more frontend-friendly not needing an additional switch for mainstream users.

Agreed. This bug is critical in both senses - from developer's point of view - that's a crash - something should be prevented at all costs, and from user point of view, where user should not need to run after the crash/exception number and read tons of logs to understand why Qemu crash or his guest crashed.

As Adam wrote, other virtualization vendors already provide a fix for such a situation, so why re-invert the wheel ? Let's just follow them, and pause the VM, with displaying a warning message to the user.

Signature · 1 line
-Alexey Eremenko "Technologov"