Explicitly create a qcow2 image
This commit is contained in:
committed by
Brian O'Connor
parent
a56e29704e
commit
ad5a0e42d0
+2
-2
@@ -186,7 +186,7 @@ def extractKernel( image, flavor ):
|
|||||||
|
|
||||||
def findBaseImage( flavor, size='8G' ):
|
def findBaseImage( flavor, size='8G' ):
|
||||||
"Return base VM image and kernel, creating them if needed"
|
"Return base VM image and kernel, creating them if needed"
|
||||||
image = path.join( VMImageDir, flavor + '-base.img' )
|
image = path.join( VMImageDir, flavor + '-base.qcow2' )
|
||||||
if path.exists( image ):
|
if path.exists( image ):
|
||||||
# Detect race condition with multiple builds
|
# Detect race condition with multiple builds
|
||||||
perms = stat( image )[ ST_MODE ] & 0777
|
perms = stat( image )[ ST_MODE ] & 0777
|
||||||
@@ -198,7 +198,7 @@ def findBaseImage( flavor, size='8G' ):
|
|||||||
run( 'mkdir -p %s' % VMImageDir )
|
run( 'mkdir -p %s' % VMImageDir )
|
||||||
iso = findiso( flavor )
|
iso = findiso( flavor )
|
||||||
log( '* Creating image file', image )
|
log( '* Creating image file', image )
|
||||||
run( 'qemu-img create %s %s' % ( image, size ) )
|
run( 'qemu-img create -f qcow2 %s %s' % ( image, size ) )
|
||||||
installUbuntu( iso, image )
|
installUbuntu( iso, image )
|
||||||
# Write-protect image, also signaling it is complete
|
# Write-protect image, also signaling it is complete
|
||||||
log( '* Write-protecting image', image)
|
log( '* Write-protecting image', image)
|
||||||
|
|||||||
Reference in New Issue
Block a user