WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] Re: [XCP] converting a .img to xva

To: gaudenziFilippo <gaudenzi.filippo@xxxxxxxxx>
Subject: Re: [Xen-users] Re: [XCP] converting a .img to xva
From: Carsten from Virtastic <carsten@xxxxxxxxxxxxx>
Date: Wed, 3 Aug 2011 14:17:26 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 03 Aug 2011 06:18:43 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=virtastic.com; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s= selector1; bh=1WBwT2DERWUA76f1XnHhpFJll3Q=; b=fKheZWAbW0T3ALZIxY EV6nOqAPh4eEDBBJX0ZUIjjXA51yO6h4bK+Hw3tfgWeIRjQBe91eOQmZLStum6fh rdEs7sI4I6etcD1qfVbufCu1NjuEOBxBH+CSgvmPWVtr0eGDbuIGDKAAr9mxIRH8 wR81xhzg5q+EgUTowhVZ4ot4c=
Domainkey-signature: a=rsa-sha1; c=nofws; d=virtastic.com; h=subject :mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= selector1; b=LrwcXD1J7YeGjkgFbkSzsE95F+JfMqX1tvcPFWFbTESapyqQgRI rZJheemNQMbt6vhBPwSofi+Jir9uPY68iQs1TvDMzqdgB++JmMJskY8uul0SlCcd T1ZS2gx5AT5QoRABXL/GVaUstHDNSV5UTh5InneOgYM7TkpkYJNMhaU4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1312376294775-4662201.post@xxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTik9bWdmZ2mjgJEz0XJ=Matr=2Wof2aXzjwkVEed@xxxxxxxxxxxxxx> <1312376294775-4662201.post@xxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Hi there,

> Hi, i have the same problem. 
> Did you resolve it? if Yes, how?

The xva format has got a bit awkward structure. Basically it's a tar file that 
contains loads of numbered files of 1M size each, or an img file cut in 
stripes, if you will.

For example, the tar file would contain:

Ref:xxx/
  00000001
  00000002
  00000003
  ....
  00001029


If one of those stripes consists entirely of zero-bytes, it won't be included 
in the xva.
Names are always just numeric and 8 bytes in length, padded and filled with 
zeros as above.

I've only done the reverse process myself, that is converting xva into img, for 
about 40 VMs. What I've done is:

- unpack tar file
- go into the Ref:xxx folder (xxx is numeric, no idea how that is determined)
- run this very simple script:

================
#!/bin/bash

dd if =/dev/zero of=blank bs=1024 count=1k
test -f image.img && rm -f image.img
touch image.img

max=`ls ???????? | sort | tail -n1`

for i in `seq 0 $max`; do

  fn=`printf "%08d" $i`
  echo -n "$fn of $max"
        
if [ -f "$fn" ]; then
  echo " - appending chunk"
  cat $fn >> image.img
else
  echo " - filling blank"
  cat blank >> image.img
fi
done

rm -f blank

echo 
"Done."
==============

Then I end up with an img file, which works perfectly fine with open source Xen.
Maybe that can help you reverse-engineer it :-)



Cheers
Carsten






_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>