Re: [pyti] Disk Handler
- yeswanth swami
- 2011-06-14 @ 11:56
2011/6/14 Alexis Métaireau <email@example.com>
> On 06/14/2011 01:10 AM, Pierre-Yves David wrote:
> > It's a very good idea to communication that fast about your finding and
> +1, this helps us a lot to follow your reasoning.
> > My problem :
> > 1) How do i create a .vdi image using libvirt
> Is the image creation a recurring problem? IOW, do we need such image
> creation on a regular basis or is it something we just want once, at the
> beginning of the process (the first time we install the guest OS). In
> the last case, we can rely on external tools / manual procedures if it
> simplify the process.
> I thought of it this way:
When ever a distribution needs to be tested, slave downloads it. It creates
a new virtual hard disk( possibly .vdi format) and upload the packages to
the disk .
We can use the same virtual disk after formatting it possibly (not sure
formatting is necessary) and we can upload the distributions and
configuration into it.
Second solution sounds easier and probably we can go for it. We can use
external tools for the one time image creation.
> > 2) How do i partition the image
> Same question than P-Y: why partitioning this image ?
We would atleast need have to write a MBR into the disk and create a
filesystem. Ofcourse this can be done when an OS is being installed on to
the disk image.
This may not be a issue then.
> > 3) How do i mount the image onto host
> I'm not sure to get which image are we talking about. It seems we have
> two images to consider (a) the operating system image and (b) the
> input/output disk.
> I am talking about image as "Virtual Hard disk image" all through the post.
i.e option (a)
> Then, we have two steps to go through for each (a) and (b): mounting the
> virtual device to the virtual machine (the equivalent of the hardware
> action to plug an hard disk to a machine) and accessing this hardware
> from the operating system (which we do using "mount" on linux systems).
> The first step (disk plug) have to be done by the host whereas the
> second one (mount) have to be done from the VM. I though it was possible
> to plug harddisk (a) directly using libvirt, Am I mistaken?
> I was not talking about mounting the disk image on the guest . Libvirt
takes care of it .
What I am more concerned here is mounting the disk image on to the host
machine once tests have been conducted
inorder to view the output(raw data).
> Mounting the virtual device (b) can probably be done directly from the
> OS. On linux, you will have to add lines into /etc/fstab.
> In all those cases, I don't see the point of using an external tool like
> libguestfs in place of directly doing so in the OS. I am a bit confused
> so please tell me if I'm missing your point.
> See you at the meeting in a few hours.
>Did you had a look at Fuse based solution ?
I found these two FUSE based solutions.
1) guestfs (which uses libguestfs) 
2) xmount 
Re: [pyti] Disk Handler
- Alexis Métaireau
- 2011-06-14 @ 12:17
On 06/14/2011 01:56 PM, yeswanth swami wrote:
> When ever a distribution needs to be tested, slave downloads it. It creates
> a new virtual hard disk( possibly .vdi format) and upload the packages to
> the disk .
> We can use the same virtual disk after formatting it possibly (not sure
> formatting is necessary) and we can upload the distributions and
> configuration into it.
> Second solution sounds easier and probably we can go for it. We can use
> external tools for the one time image creation.
Why not creating a copy of this disk at the beginning of the process and
deleting it at the end? If it's a small sized disk it can be valuable,
otherwise we'll have to mount the disk on the host, do modifications on
it etc. which can be time expensive.
> We would atleast need have to write a MBR into the disk and create a
> filesystem. Ofcourse this can be done when an OS is being installed on to
> the disk image.
> This may not be a issue then.
Yep, that could be handled at the creation of the OS (IOW, manually) :)
> What I am more concerned here is mounting the disk image on to the host
> machine once tests have been conducted
> inorder to view the output(raw data).
Ah, of course! +1 for libguestfs or equivalent solutions in this case.