Bug #106

NFS storage fails if swap space is to be created

Added by Michael Coram about 12 years ago. Updated about 12 years ago.

Status:ClosedStart date:05/11/2009
Priority:HighDue date:
Assignee:Javi Fontan% Done:

0%

Category:Drivers - Auth
Target version:Release 1.4
Resolution:fixed Pull request:
Affected Versions:

Description

The NFS version of tm_mkswap.sh ($ONE_LOCATION/lib/tm_commands/nfs/tm_mkswap.sh) does not create the 'image' directory before it attempts to write to it using dd. I'm using version 1.2.0 and if I don't modify the script, I get:

tm_mkswap.sh: ERROR: Command "dd if=/dev/zero of=/home/oneadmin/opennebula/var//4/images/disk.0 bs=1 count=1 seek=1024M" failed
tm_mkswap.sh: ERROR: dd: opening '/home/oneadmin/opennebula/var//4/images/disk.0': No such file or directory

This is resolved by adding the code from tm_clone.sh that creates the directory:
DST_DIR=`dirname $DST_PATH`

log "Creating directory $DST_DIR"
exec_and_log "mkdir -p $DST_DIR"
exec_and_log "chmod a+w $DST_DIR

I've attached the file I used successfully.

tm_mkswap.sh Magnifier - Modified version of tm_mkswap.sh (1.78 KB) Michael Coram, 05/11/2009 09:37 PM

Associated revisions

Revision 3fa925ec
Added by Javi Fontan about 12 years ago

Create dirs in tm_mkswap (#106)

git-svn-id: http://svn.opennebula.org/one/trunk@518 3034c82b-c49b-4eb3-8279-a7acafdc01c0

Revision ad90b2d2
Added by Javi Fontan about 12 years ago

Create dirs in tm_mkswap (#106)

git-svn-id: http://svn.opennebula.org/one/branches/one-1.2@518 3034c82b-c49b-4eb3-8279-a7acafdc01c0

History

#1 Updated by Ruben S. Montero about 12 years ago

  • Category set to Drivers - Auth
  • Assignee set to Javi Fontan
  • Priority changed from Low to High
  • Target version set to Release 1.4

This should be fixed for the next release.

THANKS FOR THE PATCH Michael!!!

#2 Updated by Javi Fontan about 12 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Patch applied to branch 1.2 and trunk

Also available in: Atom PDF