You are not logged in.

#26 2010-11-17 15:30:47

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Sounds good, I will give it a try, thanks.

Offline

#27 2010-12-01 05:47:27

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

0.8 is out
Not much has changed, fixed a number of bugs and added support for starting vms via libvirt.
So now it is easy to make vms for qemu, kvm, Virtualbox and Libvirt/KVM.

Enjoy!

Offline

#28 2010-12-01 10:13:39

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,000
Website

Re: varch - Virtual machine builder for ArchLinux

is the kpartx thing fixed?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#29 2010-12-01 12:01:54

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: varch - Virtual machine builder for ArchLinux

fresh aur install:

# varch
############################################################################
#                    Creating virtual machine image                        #
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Traceback (most recent call last):
  File "/usr/lib/python3.1/site-packages/varch/__init__.py", line 25, in make_vm
    nbd = image.prep_disk()
  File "/usr/lib/python3.1/site-packages/varch/image.py", line 79, in prep_disk
    return self._set_loop()
  File "/usr/lib/python3.1/site-packages/varch/image.py", line 65, in _set_loop
    loc = bytes.decode(loc.split()[4])
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/varch", line 83, in <module>
    v_arch.make_vm()
  File "/usr/lib/python3.1/site-packages/varch/__init__.py", line 75, in make_vm
    varch.clean.umount(nbd, aif.dms)
UnboundLocalError: local variable 'nbd' referenced before assignment

Offline

#30 2010-12-01 15:53:42

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Dieter@be wrote:

is the kpartx thing fixed?

What kpartx thing?

Offline

#31 2010-12-01 15:58:27

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

aeosynth wrote:

fresh aur install:

# varch
############################################################################
#                    Creating virtual machine image                        #
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Traceback (most recent call last):
  File "/usr/lib/python3.1/site-packages/varch/__init__.py", line 25, in make_vm
    nbd = image.prep_disk()
  File "/usr/lib/python3.1/site-packages/varch/image.py", line 79, in prep_disk
    return self._set_loop()
  File "/usr/lib/python3.1/site-packages/varch/image.py", line 65, in _set_loop
    loc = bytes.decode(loc.split()[4])
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/varch", line 83, in <module>
    v_arch.make_vm()
  File "/usr/lib/python3.1/site-packages/varch/__init__.py", line 75, in make_vm
    varch.clean.umount(nbd, aif.dms)
UnboundLocalError: local variable 'nbd' referenced before assignment

I am afraid that I missed listing a dependency, it looks like you don't have qemu or qemu-kvm installed, install qemu and give it another shot.

qemu is needed to create the virtual machine image. I will have a new package up momentarily

Offline

#32 2010-12-01 16:00:35

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Ryujin wrote:
Dieter@be wrote:

is the kpartx thing fixed?

What kpartx thing?

Oh! That kpartx thing,

I have not been able to merge that function into AIF yet, I keep running into problems, I have made some modifications which make the problems experienced with my kpartx hack minimal.

Last edited by Ryujin (2010-12-01 16:04:34)

Offline

#33 2010-12-01 16:04:13

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Package has been updated to address the issue experienced by aeosynth, please update to 0.8-2

Offline

#34 2010-12-20 07:19:26

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Ok, version 0.8.2 is out, I fixed a number of small bugs as well as a bug in some of the lvm aif files.
This version also allows for an "external kernel", this means that the kernel and initcpio will be coppied out of the image so that they can be booted from externally if desired.
I still need to do the aif hacking to enable installing packages from the AUR and a few other things with aif, but I felt that these updates validated a release.

Tell me what I can do to make varch better!

Offline

#35 2011-01-13 15:07:12

hexenring
Member
Registered: 2011-01-13
Posts: 3

Re: varch - Virtual machine builder for ArchLinux

aeosynth wrote:

fresh aur install:

# varch
############################################################################
#                    Creating virtual machine image                        #
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Traceback (most recent call last):
  File "/usr/bin/varch", line 83, in <module>
    v_arch.make_vm()
  File "/usr/lib/python3.1/site-packages/varch/__init__.py", line 75, in make_vm
    varch.clean.umount(nbd, aif.dms)
UnboundLocalError: local variable 'nbd' referenced before assignment

I too am seeing this exception. As far as i can tell it comes down to the use of "subprocess.getoutput()" at line 67 of image.py.

subprocess.getoutput() is not available before python 3.1, whereas I have 2.6 installed from extra. Now my issue, as a python newbie, is to get both 2.6 and 3.1 installed and varch installed and running under 3.1....

any hints?

Last edited by hexenring (2011-01-13 15:20:48)

Offline

#36 2011-01-13 15:43:00

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Hmm, that is very odd, you are certinally using python 3.1 based on the error output, so that is not the problem.

It looks like the creation of the block device is failing, this means that there is most likely an error condition which I am not checking for or a required component is missing.

I will have more time in a few hours to audit what is going on, the exception is occurring very early in the process, then the catch all to clean up the environment is picking up the exception, if you want to see the original exception you can disable the top level try/except block in /usr/lib/python3.1/site-packages/varch/__init__.py to see the first exception.

But like I said, I will take a closer look at the code in a few hours when I have time. Thanks for the find!

Offline

#37 2011-01-13 16:02:55

hexenring
Member
Registered: 2011-01-13
Posts: 3

Re: varch - Virtual machine builder for ArchLinux

Undone by my laziness again. I was using 2.6 when I recieved the original error, and copied and trimmed aeosynth's error in the quote, when pasting in my own error would have been more accurate and effective. Here's what i see under 2.6:

############################################################################
#                    Creating virtual machine image                        #
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Traceback (most recent call last):
  File "/usr/bin/varch", line 97, in <module>
    v_arch.make_vm()
  File "/usr/lib/python2.6/site-packages/varch/__init__.py", line 73, in make_vm
    varch.clean.umount(nbd, aif.dms)
UnboundLocalError: local variable 'nbd' referenced before assignment

I have gotten 3.1 running now and varch installed under python3.1/site-packages/varch and it's working well, though i haven't extensively tested the images it's creating. Under 3.1 i happily get:

############################################################################
#                    Creating virtual machine image                        #
############################################################################
#Checking that the aif configuration will be safe for the underlying system#
############################################################################
#                             Executing AIF                                #
############################################################################
Welcome to Arch Linux Installation Framework
Automatic procedure running profile /tmp/working.aif ...
Note that despite our careful coding and proper testing there may still be bugs in this software.

When you are doing this installation on a system where some data must be preserved, we suggest you make a backup first
Partitioning /dev/mapper/loop0
Disabling all swapspace...
Phase 1: Creating filesystems & blockdevices
Making ext2 filesystem on /dev/mapper/loop0p1
WARNING: process_filesystem error
Error creating filesystem ext2 on /dev/mapper/loop0p1.
Making swap filesystem on /dev/mapper/loop0p2
Making ext4 filesystem on /dev/mapper/loop0p3
Phase 2: Mounting filesystems
Mounting /dev/mapper/loop0p1 (ext2) on /boot
Swaponning /dev/mapper/loop0p2
Mounting /dev/mapper/loop0p3 (ext4) on /
WARNING: Disk processing
Could not process_filesystems
Rolling back filesystems...
Phase 1: Umounting all specified mountpoints
(Maybe) Umounting /dev/mapper/loop0p3
(Maybe) Swapoffing /dev/mapper/loop0p2
(Maybe) Umounting /dev/mapper/loop0p1
Phase 2: destructing relevant blockdevices
Skipping destruction of /dev/mapper/loop0p1 (raw) because one of the filesystems on it contains data you want to keep
Skipping destruction of /dev/mapper/loop0p2 (raw) because one of the filesystems on it contains data you want to keep
Skipping destruction of /dev/mapper/loop0p3 (raw) because one of the filesystems on it contains data you want to keep
Rollback succeeded
ERROR: Something failed while processing the filesystem.  A rollback was executed, which ended successfully
############################################################################
#                        Setting up the bootloader                         #
############################################################################
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Unmounting build environment
restoring swap state

I think that my issue derived from the dependancy on 'python' rather than 'python3'.

Thanks for the tool, I was sadly contemplating running a couple of virt servers under centos until I discovered your varch. You've saved my honour and reputation!

Offline

#38 2011-01-13 16:43:45

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Thats good to hear! I am glad I can help!
Yes, I use varch every day in a number of datacenters to farm out vms, so I feel very good about it, if you have any feature requests let me know!

And yes, since Arch has moved the python package to be python3 I wrote varch to be dependant on python3. The use of "python" as a dep is saying "python3" Vach will not run on python 2.

You are getting some errors in your filesystem creation when running AIF, I have never seen these before but there is a potential bug in the partitioning that I need to dedicate a few days to fixing, but it has never caused me any problems. Please keep me posted with your experience so I can make varch better!

Offline

#39 2011-01-13 17:38:26

hexenring
Member
Registered: 2011-01-13
Posts: 3

Re: varch - Virtual machine builder for ArchLinux

Ha. Did I mention laziness? I had a co-worker install the system from an old cd and didn't check back to see if he had run updates. I lose the game. I will let you know if I continue to get those errors after an update.

Offline

#40 2011-01-13 17:49:49

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Thanks hexenring, let me know if there is anything at all I can do to make it better, I have been focusing on some much larger projects for the last few weeks but I love varch, it is my baby smile I need to give it a few solid days and polish a few things up that are in my issues section on google code. My hope is that eventually I can get it smooth enough to make it an official Arch application.

Offline

#41 2011-10-16 08:39:05

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: varch - Virtual machine builder for ArchLinux

Hi,

varch looks like a really great project and I wanted to try it out. Unfortunately, I get a conflict when installing:

# pacman -S varch
resolving dependencies...
looking for inter-conflicts...
:: grub and grub2-common are in conflict. Remove grub2-common? [y/N] n
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: grub and grub2-common are in conflict

Is there any way to use varch without having to downgrade grub on my host machine?

Offline

#42 2011-10-16 15:18:07

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Hi wuischke,
Unfortunately, right now Varch only supports Grub 1, right now varch has to manually install grub on the virtual machine image and the support for grub 2 has not been written yet. I will look into writing Grub 2 support for Varch. Thanks for the find!

Offline

#43 2011-10-16 20:04:23

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: varch - Virtual machine builder for ArchLinux

Hi Ryujin,

no problem, I can get hold of an arch machine with grub1, if necessary.

I had a short look at the grub related code and it's not too many lines and clearly written. I might have a look at grub2 support myself, but no promises.

Offline

#44 2011-10-16 20:16:02

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

I would be very grateful to have grub2 support in Varch, and yes, it should not be hard to write. If you want to contribute it please send me a patch or a pull request on GitHub. Thanks!

Offline

#45 2011-10-16 20:51:22

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: varch - Virtual machine builder for ArchLinux

I just realised that the grub1 dependency is actually for aif, not for varch. Since grub2 and grub apparently conflict this is more complicated than I thought. This requires hacking aif to support grub2 in addition to writing the grub2 code for varch.

I'll have a look at the aif code tomorrow, but unless it's very easy to add grub2 support in addition to grub1, I lay this project on ice. I can't use grub1 on my laptop (SSD with GPT), but I can get hold of a grub1 machine without problems.

Thanks for providing such a useful tool as varch!

Offline

#46 2011-10-16 20:53:32

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

Well, that complicates things. I will take a look into it and see if a solution can be found.

Offline

#47 2011-10-18 03:30:39

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: varch - Virtual machine builder for ArchLinux

why grub2? syslinux works.


"After you do enough distro research, you will choose Arch."

Offline

#48 2011-10-18 03:46:11

Ryujin
Forum Fellow
From: Centerville, Utah
Registered: 2005-05-12
Posts: 246
Website

Re: varch - Virtual machine builder for ArchLinux

heh, I should add support for syslinux as well!

Offline

#49 2011-10-18 06:46:28

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: varch - Virtual machine builder for ArchLinux

taylorchu wrote:

why grub2? syslinux works.

You are right. I didn't know this. I might just go from grub2 to syslinux (I disliked the organisation of configuration files with grub2 anyway) and then I can use varch without problem.

Thanks for the pointer!

Offline

#50 2011-10-18 11:00:25

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: varch - Virtual machine builder for ArchLinux

I'm afraid I don't know very much but this sounded intriguing and I thought I'd give it a try. And since I try most things inside a virtual machine, I ran "varch -f vdi -s 3G -i varch" inside one just after installing varch. I got the following:

############################################################################
#                    Creating virtual machine image                        #
read error, sector 0
llseek error
llseek error
llseek error
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Traceback (most recent call last):
  File "/usr/lib/python3.2/site-packages/varch/__init__.py", line 25, in make_vm
    nbd = image.prep_disk()
  File "/usr/lib/python3.2/site-packages/varch/image.py", line 79, in prep_disk
    return self._set_loop()
  File "/usr/lib/python3.2/site-packages/varch/image.py", line 65, in _set_loop
    loc = bytes.decode(loc.split()[4])
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/varch", line 96, in <module>
    v_arch.make_vm()
  File "/usr/lib/python3.2/site-packages/varch/__init__.py", line 75, in make_vm
    varch.clean.umount(nbd, aif.dms)
UnboundLocalError: local variable 'nbd' referenced before assignment

Can this be run inside virtualbox?

*EDIT*

Since I had just SYUed, I thought a reboot might give me different results. So, same command now gives me:

############################################################################
#                    Creating virtual machine image                        #
############################################################################
#Checking that the aif configuration will be safe for the underlying system#
############################################################################
#                             Executing AIF                                #
############################################################################
Welcome to Arch Linux Installation Framework
ERROR: You did not specify $TARGET_REPOSITORIES
############################################################################
#                        Setting up the bootloader                         #
############################################################################
############################################################################
#                     Cleaning up the build environment                    #
############################################################################
Unmounting build environment
restoring swap state

Last edited by stryder (2011-10-18 11:05:51)

Offline

Board footer

Powered by FluxBB