On Wed, 2007-07-18 at 11:28 -0400, Asrai khn wrote:> Hi I am wondering is there an easy way to configure domU (vm) quickly, > atm we are using eg LV (Logical Volumes) to storge root, var and swap > for VM and then using disk = [ ''phy:vg/myvmdisk1,sda1,w'', ... ,... ] > to launch it. > > We takes the tar gunzip of file system of root, var of currently > running vm and when need arrives we just have to created LVs and > untar the achieves and launch the new vm with very little changes. > > Only one problem in this approach is that we get little outdated vm > which need to update using ''yum''. So is there a way to start new vm > fast and using currently updated running vm file system? > > Thanks. Askar.You could use LVM snapshots. They''re copy-on-write, so they can be created quickly. Of course, if you start a new VM on a snapshot of a running VM, then the filesystem will not be clean (it will look as though it was from a system that was turned off without being shutdown). -- Chris Tyler http://dailypackage.fedorabook.com/
Chris Tyler wrote:> On Wed, 2007-07-18 at 11:28 -0400, Asrai khn wrote: > >> Hi I am wondering is there an easy way to configure domU (vm) quickly, >> atm we are using eg LV (Logical Volumes) to storge root, var and swap >> for VM and then using disk = [ ''phy:vg/myvmdisk1,sda1,w'', ... ,... ] >> to launch it. >> >> We takes the tar gunzip of file system of root, var of currently >> running vm and when need arrives we just have to created LVs and >> untar the achieves and launch the new vm with very little changes. >> >> Only one problem in this approach is that we get little outdated vm >> which need to update using ''yum''. So is there a way to start new vm >> fast and using currently updated running vm file system? >> >> Thanks. Askar. >> > > You could use LVM snapshots. They''re copy-on-write, so they can be > created quickly. Of course, if you start a new VM on a snapshot of a > running VM, then the filesystem will not be clean (it will look as > though it was from a system that was turned off without being shutdown). > > -- > Chris Tyler > http://dailypackage.fedorabook.com/I''ve found an easy way is just to use dd. dd if=/dev/VolGroup00/virtual-1 of=/dev/VolGroup00/virtual-2 bs=1M I''ve tried LVM snapshots, but found that sometimes they seemed to run slowly, and if you made a copy of a copy, they ran even more slowly. Perhaps they work fine under some conditions, but they didn''t for me. dd, however, has never failed me. Just remember to start it up in console mode first, and change the ip address. Also, (you probably know this, but), don''t forget to change the mac address and uuid when you copy the xen config file (and rename the machine, too.) Bill Jenkins CAIT, Western Illinois University
On Wed, 18 Jul 2007, Bill Jenkins wrote:> I''ve found an easy way is just to use dd. > > dd if=/dev/VolGroup00/virtual-1 of=/dev/VolGroup00/virtual-2 bs=1M > > I''ve tried LVM snapshots, but found that sometimes they seemed to run > slowly, and if you made a copy of a copy, they ran even more slowly. > Perhaps they work fine under some conditions, but they didn''t for me. > dd, however, has never failed me. Just remember to start it up in > console mode first, and change the ip address. Also, (you probably know > this, but), don''t forget to change the mac address and uuid when you > copy the xen config file (and rename the machine, too.) > > Bill Jenkins > CAIT, Western Illinois UniversityHi Bill, I''ve been grappling with just this issue (at least, I *think* we''re talking about the same thing) - trying to take an existing ''image'' of a virtual box and tweak it to use as a base for creating other virtual boxes. One thing, though - if you''re using full virtualization (as we are, under Red Hat Enterprise Linux 5), can you still use the console? I''ve been trying to start the base domU using ''xm create domainname -c'', but it just bounces me to a ''?'' prompt that doesn''t allow any input, and the only way I can get out of it is to use another connection to shutdown the domain. I''ve also tried using ''xm console domainname'' to connect to the domain when it is already running, but I get the same response. Many thanks, Hope Dundas ~~~ Hope Dundas, hope.dundas@umich.edu Database/Systems Administrator Housing Information Technology Office University of Michigan
We are probably talking about the same thing. We have lots of multiprocessor machines that we like to set up identically. In the case of the latest machines, that means I take one virtual machine, set it up like I like it with LDAP, directory mounts, perl scripts, etc, and then clone that one seven times with dd. As I copy, I boot them into single-user mode and change the hostname and ip, and once over with, I''ve got eight identical machines, other than hostname and ip. Some of the perl stuff is pretty tedious, so it saves a lot of time. I''ve found that if I do an "xm create virtualmachinename -c" from the command line, I''ll get the normal startup sequence, and then I can enter single user mode and change the ip and such. Sometimes it seems like the command-line console doesn''t work, so instead I run virt-manager and get a console window that way. But unless something messed up with dd, I always get a console somewhere. I will mention that I usually stop domains before dd-ing them; I have made good copies of domains while they were running, but sometimes it messes them up...is what I''ve described what you''d like to accomplish? I''ve used the procedure to clone probably 50 or so domains. The developers sometimes want a different OS to run apps on, so I just go and re-copy a fresh OS when they do. Oh by the way, I''ve experimented with dd-ing domains through gzip into a file, and restoring from a file, which works sometimes. Bill Jenkins CAIT,Western Illinois University | | Hi Bill, | | I''ve been grappling with just this issue (at least, I *think* we''re | talking about the same thing) - trying to take an existing ''image'' of | a | virtual box and tweak it to use as a base for creating other virtual | boxes. | | One thing, though - if you''re using full virtualization (as we are, | under | Red Hat Enterprise Linux 5), can you still use the console? I''ve been | | trying to start the base domU using ''xm create domainname -c'', but it | just | bounces me to a ''?'' prompt that doesn''t allow any input, and the only | way | I can get out of it is to use another connection to shutdown the | domain. | I''ve also tried using ''xm console domainname'' to connect to the domain | | when it is already running, but I get the same response. | | Many thanks, | | Hope Dundas | | ~~~ | Hope Dundas, hope.dundas@umich.edu | Database/Systems Administrator | Housing Information Technology Office | University of Michigan
Hi, Thanks every body who have contributed the way you people setup xen VM quickly, now I have lot of options/ideas and I hope next time it wouldn''t be hard to setup vm fast :) Thanks and regards, Askar
Hope Dundas
2007-Jul-19 15:08 UTC
No UDP? - was Re: [Fedora-xen] Re: easy way to configure domU
Hi Bill, thanks for writing back. :) My odd problem seems to be that I can get nearly everything working on the new, cloned box except for DNS. And in particular, DNS over UDP - I can use dig +tcp to force resolution over TCP, but it otherwise just hangs thusly: ; <<>> DiG 9.3.3rc2 <<>> @x.x.x.x domain.com ; (1 server found) ;; global options: printcmd ;; connection timed out; no servers could be reached [root@hsg-vdev ~]# nslookup behaves the same way. Has anyone else seen this? This is the second clone I''ve taken of the original box (which has never had any issues with DNS). I''m doing a lot of looking via google, and have seen many references to bad udp checksums, but when I run tcpdump -nvvi eth0 port 53 it shows the checksums as OK. Aside: Because we''re using full virtualization (RHEL5, x86_64), the console isn''t available by default (needs to be conf''d in grub.conf prior to boot), I wasn''t able to access it that way, and so the first boot was to normal runlevel - I couldn''t figure out how to make the freshly-created machine boot to single user. I did stop the source machine before doing the dd of it, and got a randomly generated uuid and MAC address. If anyone has seen this behavior before and knows of a fix, please let me know. Many thanks, Hope Dundas> | Hope Dundas, hope.dundas@umich.edu > | Database/Systems Administrator > | Housing Information Technology Office > | University of Michigan
> > One thing, though - if you''re using full virtualization (as we are, > under Red Hat Enterprise Linux 5), can you still use the console? I''ve > been trying to start the base domU using ''xm create domainname -c'', but > it just bounces me to a ''?'' prompt that doesn''t allow any input, and the > only way I can get out of it is to use another connection to shutdown > the domain. I''ve also tried using ''xm console domainname'' to connect to > the domain when it is already running, but I get the same response.if you are using full virt the -c will not worked. You can still mount the partition from the VM directly on your system. You may want to look at kpartx ( if you are using lvm in your guest )/ lomount ( if no LVM in guest ) to achieve it. Regards, Olivier
Hi, I have the same console problem with Full Virtualization... As I am not using any graphic card, I would have liked to use a serial console to connect to my Full Virtualized DomU''s console. Do anybody knows how to do this ? thanks -- - - - - - - - - - - - - - - - - - - - - - - - - - Emre ERALTAN Elève ingénieur 3ème année Electronique et Informatique Industrielle ENSSAT - - - - - - - - - - - - - - - - - - - - - - - - - On 7/19/07, Olivier Renault <orenault@redhat.com> wrote:> > > > > One thing, though - if you''re using full virtualization (as we are, > > under Red Hat Enterprise Linux 5), can you still use the console? I''ve > > been trying to start the base domU using ''xm create domainname -c'', but > > it just bounces me to a ''?'' prompt that doesn''t allow any input, and the > > only way I can get out of it is to use another connection to shutdown > > the domain. I''ve also tried using ''xm console domainname'' to connect to > > the domain when it is already running, but I get the same response. > > if you are using full virt the -c will not worked. > > You can still mount the partition from the VM directly on your system. > You may want to look at kpartx ( if you are using lvm in your guest )/ > lomount ( if no LVM in guest ) to achieve it. > > Regards, > Olivier > > -- > Fedora-xen mailing list > Fedora-xen@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-xen >
Emre ERALTAN wrote:> Hi, > > I have the same console problem with Full Virtualization... As I am not > using any graphic card, I would have liked to use a serial console to > connect to my Full Virtualized DomU''s console. Do anybody knows how to > do this ? >Yes, it is actually all setup, you really just need to tell your virtual machine to use the serial console. So for instance, on the kernel command-line (in grub) inside the domain, you would add: console=ttyS0,115200 to the "kernel" line, and reboot. You should also be able to tell grub to use the serial console to allow you to select kernels, but I haven''t tried that personally. Chris Lalancette