Hi, I have a tar of an centos file system that was previously a xen vm, I want to recreate a vm using this un-tared set of files. What is the best way to do this? I am brand new to xen, but have a fedora setup running a xen base vm and I have virtual machine manager. I tried it that way but it wanted an image file or regular cd to create an image. thanks Joel _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
just untar to a partition or virtual file system. It is covered in the xen manual weiming On Feb 13, 2008 4:06 PM, Joel Nylund <jnylund@yahoo.com> wrote:> Hi, I have a tar of an centos file system that was previously a xen > vm, I want to recreate a vm using this un-tared set of files. What is > the best way to do this? > > I am brand new to xen, but have a fedora setup running a xen base vm > and I have virtual machine manager. I tried it that way but it wanted > an image file or regular cd to create an image. > > thanks > Joel > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nico Kadel-Garcia
2008-Feb-13 23:41 UTC
Re: [Xen-users] how to create a vm from a file system
weiming wrote:> just untar to a partition or virtual file system. > It is covered in the xen manual > > weimingOh, wait. You have to build the file system first, edit /etc/mtab and /etc/fstab appropriately, make sure your kernel has the appropriate modules to access the Xen virtual hardware for network and hard drive controllers, and be prepared to reset all your SELinux settings. It''s not as easy as many manuals make it out to be. It''s often easiest to actually delete the kernel, and do a Fedora upgrade or install on top of the existing OS with the virt-install tool. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi, I have looked through the manual now, but I still dont get it. Lets say I have a standard fedora setup running xen kernel & xen I have a the filesystem I want the vm to use (files given to me from a previously used vm ) starting with its root starting at (/root/vms/ jnylund2) My hard drive devices are: Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 30401 244091610 8e Linux LVM I created a config file with the following: # Kernel image file. kernel = "vmlinuz-2.6.20-1.3002.fc6xen" memory =512 name = "jnylund2" vif = [ '''' ] disk = [ ''phy:sda2,sda2,w'' ] dhcp="dhcp" hostname= "vm%d" % vmid #root = "/root/vms/jnylund2" root = "/dev/sda1 ro" #extra = "4" When I try to run: [root@mymachine vms]# xm create -c j2-conf vmid=1 Using config file "./j2-conf". Error: int argument required It doesn''t work, and I also dont understand where im supposed to tell it to use /root/vms/jnylund2 as the root of the virtual machines file system. thanks Joel On Feb 13, 2008, at 6:41 PM, Nico Kadel-Garcia wrote:> weiming wrote: >> just untar to a partition or virtual file system. >> It is covered in the xen manual >> >> weiming > Oh, wait. You have to build the file system first, edit /etc/mtab > and /etc/fstab appropriately, make sure your kernel has the > appropriate modules to access the Xen virtual hardware for network > and hard drive controllers, and be prepared to reset all your > SELinux settings. > > It''s not as easy as many manuals make it out to be. It''s often > easiest to actually delete the kernel, and do a Fedora upgrade or > install on top of the existing OS with the virt-install tool. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hello, Here is a sample working config file using LVM, I have swapped out some of it for made up names to keep it private,i hope this helps # -*- mode: python; -*- kernel = "/boot/vmlinuz-2.6.12-xenU" memory = 64 name = "hostname" vif = [''bridge=xenbr0'' ] disk = [''phy:/dev/XEN/disk,hda1,w'',''phy:/dev/XEN/diskswap,sda2,w''] ip="*.*.*.*" netmask="255.255.255.0" gateway="*.*.*.*" hostname = "hostname.domain.com" root = "/dev/hda1 ro" extra = "3" -----Original Message----- From: xen-users-bounces@lists.xensource.com [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Joel Nylund Sent: 14 February 2008 18:40 To: xen-users@lists.xensource.com Subject: Re: [Xen-users] how to create a vm from a file system Hi, I have looked through the manual now, but I still dont get it. Lets say I have a standard fedora setup running xen kernel & xen I have a the filesystem I want the vm to use (files given to me from a previously used vm ) starting with its root starting at (/root/vms/ jnylund2) My hard drive devices are: Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 30401 244091610 8e Linux LVM I created a config file with the following: # Kernel image file. kernel = "vmlinuz-2.6.20-1.3002.fc6xen" memory =512 name = "jnylund2" vif = [ '''' ] disk = [ ''phy:sda2,sda2,w'' ] dhcp="dhcp" hostname= "vm%d" % vmid #root = "/root/vms/jnylund2" root = "/dev/sda1 ro" #extra = "4" When I try to run: [root@mymachine vms]# xm create -c j2-conf vmid=1 Using config file "./j2-conf". Error: int argument required It doesn''t work, and I also dont understand where im supposed to tell it to use /root/vms/jnylund2 as the root of the virtual machines file system. thanks Joel On Feb 13, 2008, at 6:41 PM, Nico Kadel-Garcia wrote:> weiming wrote: >> just untar to a partition or virtual file system. >> It is covered in the xen manual >> >> weiming > Oh, wait. You have to build the file system first, edit /etc/mtab > and /etc/fstab appropriately, make sure your kernel has the > appropriate modules to access the Xen virtual hardware for network > and hard drive controllers, and be prepared to reset all your > SELinux settings. > > It''s not as easy as many manuals make it out to be. It''s often > easiest to actually delete the kernel, and do a Fedora upgrade or > install on top of the existing OS with the virt-install tool. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks Ian, I used your example and I get this message now: [root@keepup1 vms]# xm create -c jnew vmid=1 Using config file "./jnew". Error: Device 769 (vbd) could not be connected. Device /root/vms/jnylund2 is mounted in the privileged domain, and so cannot be mounted by a guest. My conf file is: [root@keepup1 vms]# cat jnew # -*- mode: python; -*- kernel = "/boot/vmlinuz-2.6.20-1.3002.fc6xen" memory = 512 name = "jnylund2" vif = [''bridge=xenbr0'' ] disk = [''phy:/root/vms/jnylund2,hda1,w'',''phy:/root/vms/j2swap,sda2,w''] ip="*.*.*.*" netmask="255.255.255.0" gateway="*.*.*.*" hostname = "test2.domain.com" root = "/dev/hda1 ro" extra = "3" any ideas? thanks Joel On Feb 14, 2008, at 3:52 PM, Ian Tobin wrote:> Hello, > > Here is a sample working config file using LVM, I have swapped out > some > of it for made up names to keep it private,i hope this helps > > # -*- mode: python; -*- > kernel = "/boot/vmlinuz-2.6.12-xenU" > memory = 64 > name = "hostname" > vif = [''bridge=xenbr0'' ] > disk = [''phy:/dev/XEN/disk,hda1,w'',''phy:/dev/XEN/diskswap,sda2,w''] > ip="*.*.*.*" > netmask="255.255.255.0" > gateway="*.*.*.*" > hostname = "hostname.domain.com" > root = "/dev/hda1 ro" > extra = "3" > > -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of Joel > Nylund > Sent: 14 February 2008 18:40 > To: xen-users@lists.xensource.com > Subject: Re: [Xen-users] how to create a vm from a file system > > Hi, I have looked through the manual now, but I still dont get it. > > Lets say I have a standard fedora setup running xen kernel & xen > > I have a the filesystem I want the vm to use (files given to me from a > previously used vm ) starting with its root starting at (/root/vms/ > jnylund2) > > My hard drive devices are: > Device Boot Start End Blocks Id System > /dev/sda1 * 1 13 104391 83 Linux > /dev/sda2 14 30401 244091610 8e Linux LVM > > I created a config file with the following: > > # Kernel image file. > kernel = "vmlinuz-2.6.20-1.3002.fc6xen" > memory =512 > name = "jnylund2" > vif = [ '''' ] > disk = [ ''phy:sda2,sda2,w'' ] > dhcp="dhcp" > hostname= "vm%d" % vmid > #root = "/root/vms/jnylund2" > root = "/dev/sda1 ro" > #extra = "4" > > When I try to run: > [root@mymachine vms]# xm create -c j2-conf vmid=1 > Using config file "./j2-conf". > Error: int argument required > > It doesn''t work, and I also dont understand where im supposed to tell > it to use /root/vms/jnylund2 as the root of the virtual machines file > system. > > thanks > Joel > > > > > On Feb 13, 2008, at 6:41 PM, Nico Kadel-Garcia wrote: > >> weiming wrote: >>> just untar to a partition or virtual file system. >>> It is covered in the xen manual >>> >>> weiming >> Oh, wait. You have to build the file system first, edit /etc/mtab >> and /etc/fstab appropriately, make sure your kernel has the >> appropriate modules to access the Xen virtual hardware for network >> and hard drive controllers, and be prepared to reset all your >> SELinux settings. >> >> It''s not as easy as many manuals make it out to be. It''s often >> easiest to actually delete the kernel, and do a Fedora upgrade or >> install on top of the existing OS with the virt-install tool. >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users