Rickard Borgmäster
2006-Jan-24 10:33 UTC
[Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
Hello, I need to know what''s needed to implement cow filesystem for domU the same way it was done on the LiveCD demo for xen 3.0. Our current project it is replace UML with XEN on a bootable router simulation LiveCD. We need to make each domU machine share the same rootfs.img. And I know it is possible, as it was done on the demo LiveCD. But how? And, where can I find some documentation about domU config files disk= parameter? What is documented in the handbook is far from sufficient. Looking at the config file on the demo CD: /root/deb-conf says: disk = [''cow:/tmp/cdrom/rootfs.img 30,sda1,w''] what does "30" mean here? A little bit hard to guess... Right now, I''ve set up a xen 3.0 server for testing and mastering purposes. I''ve created a filesystem image that will work fine when not using cow (meaning, disk = [''file:/xen/rootfs.img,hda1,w''] in domU.cfg). Just changing this parameter to disk = [''cow:/xen/rootfs.img 30,hda1,w''] (again, what is "30" for?) gives me error; Error: Device 769 (vbd) could not be connected. Hotplug scripts are not working. Please! Share any experiences or knowledge you might have here. None of the project members are coders, so we cannot read source code like native language. Any help is truely appreciated. Best regards Rickard Borgmäster _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Deegan
2006-Jan-24 11:24 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On Tue, Jan 24, 2006 at 11:33:43AM +0100, Rickard Borgm?ster wrote:> I need to know what''s needed to implement cow filesystem for domU the > same way it was done on the LiveCD demo for xen 3.0. Our current project > it is replace UML with XEN on a bootable router simulation LiveCD. We > need to make each domU machine share the same rootfs.img. And I know it > is possible, as it was done on the demo LiveCD. But how?I think you''ll need to copy over some of the scripts from the demo CD: /etc/xen/scripts/block-cow /usr/sbin/create_cow /usr/sbin/destroy_cow> disk = [''cow:/tmp/cdrom/rootfs.img 30,sda1,w''] > what does "30" mean here? A little bit hard to guess...30 is the size of backing file to use, in this case 30MB. Tim -- Tim Deegan (My opinions, not the University''s) Systems Research Group University of Cambridge Computer Laboratory _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Rickard Borgmäster
2006-Jan-24 17:07 UTC
[Xen-users] Re: How was CoW implemented on the Demo LiveCD (3.0) ??
Tim Deegan wrote:> On Tue, Jan 24, 2006 at 11:33:43AM +0100, Rickard Borgm?ster wrote: > >>I need to know what''s needed to implement cow filesystem for domU the >>same way it was done on the LiveCD demo for xen 3.0. Our current project >>it is replace UML with XEN on a bootable router simulation LiveCD. We >>need to make each domU machine share the same rootfs.img. And I know it >>is possible, as it was done on the demo LiveCD. But how? > > > I think you''ll need to copy over some of the scripts from the demo CD: > > /etc/xen/scripts/block-cow > /usr/sbin/create_cow > /usr/sbin/destroy_cowHey Tim, thanks for your answer. I realized that this could be the case, that there were scripts on the CD not included in the distribution. I''ve been struggling with this all day now. Sigh. And ppl they say that computer work cannot be exhausting :-/ Well, anyways. I''ve put those files into place and been trying to get it to work in many different ways. zNone worked :-( The only meaningful error message I can find is: Error: Device 769 (vbd) could not be connected. Backend device not found. Since I''m new to CoW aswell, i do not know what to look for. I realize that I should see some devices in /dev/mapper (which I don''t). But I do not know how to troubleshoot. Anyways, I just realized that I could "test run" the scripts manually if I just can figure out the parameters. And what do you know... I got results. create_cow without the -q parameter reported that dmsetup was missing. Some apt-get later... it just worked. My co-workers had their ears blown out by my heureka... Well, now I''m off home. Hope to make some more progress on the livecd tomorrow :-) Best regards Rickard Borgmäster _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-24 19:25 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
Can the same method of cow used in the LiveCD be implemented with LVM ? instead of the flat images ? Thanks. On 1/24/06, Tim Deegan <Tim.Deegan@cl.cam.ac.uk> wrote:> > I think you''ll need to copy over some of the scripts from the demo CD: > > /etc/xen/scripts/block-cow > /usr/sbin/create_cow > /usr/sbin/destroy_cow > > > disk = [''cow:/tmp/cdrom/rootfs.img 30,sda1,w''] > > what does "30" mean here? A little bit hard to guess... > > 30 is the size of backing file to use, in this case 30MB. >-- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Deegan
2006-Jan-25 10:14 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On Wed, Jan 25, 2006 at 12:55:16AM +0530, Anand wrote:> Can the same method of cow used in the LiveCD be implemented with LVM ? > instead of the flat images ?I''ve never tried it, but it should be possible to use the dmsetup runes on any block device. In fact Andrew Peace''s create_cow script from the Xen3 demo CD does try to do the right thing if you give it a block device instead of a file (i.e. not pass it through a loop device). Don''t the LVM tools provide a copy-on-write snapshot facility already? Tim. -- Tim Deegan (My opinions, not the University''s) Systems Research Group University of Cambridge Computer Laboratory _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ernst Bachmann
2006-Jan-25 10:59 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On Wednesday 25 January 2006 11:14, Tim Deegan wrote:> On Wed, Jan 25, 2006 at 12:55:16AM +0530, Anand wrote: > > Can the same method of cow used in the LiveCD be implemented with LVM ? > > instead of the flat images ? > > I''ve never tried it, but it should be possible to use the dmsetup runes > on any block device. In fact Andrew Peace''s create_cow script from the > Xen3 demo CD does try to do the right thing if you give it a block > device instead of a file (i.e. not pass it through a loop device). > > Don''t the LVM tools provide a copy-on-write snapshot facility already?LVM is just a "wrapper" arround the device mapper, it provides a more "user-friendly" interface for creating dm rules, and stores them persistently in its superblock. But the LVM Cow features seem to be more geared towards backups, i.e. create a RO snapshot, backup it, release the snapshot again. And they seem to be quite unstable, I''d not try to use it on a LVM VG containing valuable data yet. And for backing a domU root partition, block based CoW implementations are generally not very usefull, as you don''t have a way to change the "master copy" (like installing a security update etc) and have those changes appear in all clones. File-based implementations like unionfs are IMHO better suited for that task. /Ernst _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-25 11:00 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On 1/25/06, Tim Deegan <Tim.Deegan@cl.cam.ac.uk> wrote:> > On Wed, Jan 25, 2006 at 12:55:16AM +0530, Anand wrote: > > Can the same method of cow used in the LiveCD be implemented with LVM ? > > instead of the flat images ? > > I''ve never tried it, but it should be possible to use the dmsetup runes > on any block device. In fact Andrew Peace''s create_cow script from the > Xen3 demo CD does try to do the right thing if you give it a block > device instead of a file (i.e. not pass it through a loop device). > > Don''t the LVM tools provide a copy-on-write snapshot facility already? >LVM has snapshot features which are not stable. Seeing this post i thought if it was possible to use the same feature but with LVM instead of flat files. -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-25 12:14 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
I copied the /etc/xen/scripts/block-cow, /usr/sbin/create_cow, /usr/sbin/destroy_cow files from the demo cd onto the testing machine. When i try to use the same line as in the centos config file in the demo cd, i get the following: [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:177) XendDomainInfo.create([''vm'', [''name'', ''vm01''], [''memory'', ''32''], [''image'', [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.12.6-xen''], [''ramdisk'', ''/boot/initrd-2.6.12.6-xen.img''], [''root'', ''/dev/sda1 ro''], [''args'', ''selinux=0 elevator=cfq''], [''vcpus'', ''1''], [''vcpus'', ''1''], [''boot'', ''c''], [''nics'', ''1'']]], [''device'', [''vbd'', [''uname'', ''cow:/root/xen/centos.4-2.img50''], [''dev'', ''sda1''], [''mode'', ''w'']]], [''device'', [''vbd'', [''uname'', ''file:/root/xen/centos.swap''], [''dev'', ''sda2''], [''mode'', ''w'']]], [''device'', [''vif'', [''mac'', ''AA:00:00:18:98:FB''], [''vifname'', ''vm01''], [''bridge'', ''xenbr0'']]]]) [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:282) parseConfig: config is [''vm'', [''name'', ''vm01''], [''memory'', ''32''], [''image'', [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.12.6-xen''], [''ramdisk'', ''/boot/initrd-2.6.12.6-xen.img''], [''root'', ''/dev/sda1 ro''], [''args'', ''selinux=0 elevator=cfq''], [''vcpus'', ''1''], [''vcpus'', ''1''], [''boot'', ''c''], [''nics'', ''1'']]], [''device'', [''vbd'', [''uname'', ''cow:/root/xen/centos.4-2.img50''], [''dev'', ''sda1''], [''mode'', ''w'']]], [''device'', [''vbd'', [''uname'', ''file:/root/xen/centos.swap''], [''dev'', ''sda2''], [''mode'', ''w'']]], [''device'', [''vif'', [''mac'', ''AA:00:00:18:98:FB''], [''vifname'', ''vm01''], [''bridge'', ''xenbr0'']]]] [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:374) parseConfig: result is {''ssidref'': None, ''uuid'': None, ''on_crash'': None, ''on_reboot'': None, ''image'': [''linux'', [''kernel'', ''/boot/vmlinuz-2.6.12.6-xen''], [''ramdisk'', ''/boot/initrd-2.6.12.6-xen.img''], [''root'', ''/dev/sda1 ro''], [''args'', ''selinux=0 elevator=cfq''], [''vcpus'', ''1''], [''vcpus'', ''1''], [''boot'', ''c''], [''nics'', ''1'']], ''on_poweroff'': None, ''cpus'': None, ''name'': ''vm01'', ''backend'': [], ''vcpus'': 1, ''cpu_weight'': None, ''vcpu_avail'': None, ''memory'': 32, ''device'': [(''vbd'', [''vbd'', [''uname'', ''cow:/root/xen/centos.4-2.img 50''], [''dev'', ''sda1''], [''mode'', ''w'']]), (''vbd'', [''vbd'', [''uname'', ''file:/root/xen/centos.swap''], [''dev'', ''sda2''], [''mode'', ''w'']]), (''vif'', [''vif'', [''mac'', ''AA:00:00:18:98:FB''], [''vifname'', ''vm01''], [''bridge'', ''xenbr0'']])], ''bootloader'': None, ''cpu'': None, ''maxmem'': None} [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:1129) XendDomainInfo.construct: None 0 [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:1161) XendDomainInfo.initDomain: 50 1.0 [2006-01-25 17:35:30 xend] DEBUG (balloon:84) Balloon: free 746; need 33; done. [2006-01-25 17:35:30 xend] INFO (image:132) buildDomain os=linux dom=50 vcpus=1 [2006-01-25 17:35:30 xend] DEBUG (image:170) dom = 50 [2006-01-25 17:35:30 xend] DEBUG (image:171) image = /boot/vmlinuz- 2.6.12.6-xen [2006-01-25 17:35:30 xend] DEBUG (image:172) store_evtchn = 1 [2006-01-25 17:35:30 xend] DEBUG (image:173) console_evtchn = 2 [2006-01-25 17:35:30 xend] DEBUG (image:174) cmdline root=/dev/sda1 ro selinux=0 elevator=cfq [2006-01-25 17:35:30 xend] DEBUG (image:175) ramdisk = /boot/initrd- 2.6.12.6-xen.img [2006-01-25 17:35:30 xend] DEBUG (image:176) vcpus = 1 [2006-01-25 17:35:30 xend] DEBUG (blkif:24) exception looking up device number for sda1: [Errno 2] No such file or directory: ''/dev/sda1'' [2006-01-25 17:35:30 xend] DEBUG (DevController:104) DevController: writing {''virtual-device'': ''2049'', ''backend-id'': ''0'', ''state'': ''1'', ''backend'': ''/local/domain/0/backend/vbd/50/2049''} to /local/domain/50/device/vbd/2049. [2006-01-25 17:35:30 xend] DEBUG (DevController:106) DevController: writing {''domain'': ''vm01'', ''frontend'': ''/local/domain/50/device/vbd/2049'', ''dev'': ''sda1'', ''state'': ''1'', ''params'': ''/root/xen/centos.4-2.img 50'', ''mode'': ''w'', ''frontend-id'': ''50'', ''type'': ''cow''} to /local/domain/0/backend/vbd/50/2049. [2006-01-25 17:35:30 xend] DEBUG (blkif:24) exception looking up device number for sda2: [Errno 2] No such file or directory: ''/dev/sda2'' [2006-01-25 17:35:30 xend] DEBUG (DevController:104) DevController: writing {''virtual-device'': ''2050'', ''backend-id'': ''0'', ''state'': ''1'', ''backend'': ''/local/domain/0/backend/vbd/50/2050''} to /local/domain/50/device/vbd/2050. [2006-01-25 17:35:30 xend] DEBUG (DevController:106) DevController: writing {''domain'': ''vm01'', ''frontend'': ''/local/domain/50/device/vbd/2050'', ''dev'': ''sda2'', ''state'': ''1'', ''params'': ''/root/xen/centos.swap'', ''mode'': ''w'', ''frontend-id'': ''50'', ''type'': ''file''} to /local/domain/0/backend/vbd/50/2050. [2006-01-25 17:35:30 xend] DEBUG (DevController:104) DevController: writing {''backend-id'': ''0'', ''mac'': ''AA:00:00:18:98:FB'', ''handle'': ''0'', ''state'': ''1'', ''backend'': ''/local/domain/0/backend/vif/50/0''} to /local/domain/50/device/vif/0. [2006-01-25 17:35:30 xend] DEBUG (DevController:106) DevController: writing {''bridge'': ''xenbr0'', ''domain'': ''vm01'', ''handle'': ''0'', ''script'': ''/etc/xen/scripts/vif-bridge'', ''state'': ''1'', ''frontend'': ''/local/domain/50/device/vif/0'', ''mac'': ''AA:00:00:18:98:FB'', ''vifname'': ''vm01'', ''frontend-id'': ''50''} to /local/domain/0/backend/vif/50/0. [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:661) Storing VM details: {''ssidref'': ''0'', ''uuid'': ''c0cc9a09-8da6a9f9-b6c7a099-b87607ad'', ''on_reboot'': ''restart'', ''start_time'': ''1138190730.29'', ''on_poweroff'': ''destroy'', ''name'': ''vm01'', ''vcpus'': ''1'', ''vcpu_avail'': ''1'', ''memory'': ''32'', ''on_crash'': ''restart'', ''image'': "(linux (kernel /boot/vmlinuz-2.6.12.6-xen) (ramdisk /boot/initrd-2.6.12.6-xen.img) (root ''/dev/sda1 ro'') (args ''selinux=0 elevator=cfq'') (vcpus 1) (vcpus 1) (boot c) (nics 1))", ''maxmem'': ''32''} [2006-01-25 17:35:30 xend.XendDomainInfo] DEBUG (XendDomainInfo:686) Storing domain details: {''console/ring-ref'': ''49179'', ''console/port'': ''2'', ''name'': ''vm01'', ''console/limit'': ''1048576'', ''vm'': ''/vm/c0cc9a09-8da6a9f9-b6c7a099-b87607ad'', ''domid'': ''50'', ''cpu/0/availability'': ''online'', ''memory/target'': ''32768'', ''store/ring-ref'': ''58180'', ''store/port'': ''1''} [2006-01-25 17:35:30 xend] DEBUG (DevController:133) Waiting for devices vif. [2006-01-25 17:35:30 xend] DEBUG (DevController:139) Waiting for 0. [2006-01-25 17:35:30 xend] DEBUG (DevController:409) hotplugStatusCallback /local/domain/0/backend/vif/50/0/hotplug-status. [2006-01-25 17:35:30 xend] DEBUG (DevController:409) hotplugStatusCallback /local/domain/0/backend/vif/50/0/hotplug-status. [2006-01-25 17:35:30 xend] DEBUG (DevController:426) hotplugStatusCallback 1. [2006-01-25 17:35:30 xend] DEBUG (DevController:133) Waiting for devices usb. [2006-01-25 17:35:30 xend] DEBUG (DevController:133) Waiting for devices vbd. [2006-01-25 17:35:30 xend] DEBUG (DevController:139) Waiting for 2049. [2006-01-25 17:35:30 xend] DEBUG (DevController:409) hotplugStatusCallback /local/domain/0/backend/vbd/50/2049/hotplug-status. [2006-01-25 17:35:30 xend] DEBUG (DevController:426) hotplugStatusCallback 3. [2006-01-25 17:35:30 xend] ERROR (SrvBase:87) Request wait_for_devices failed. Traceback (most recent call last): File "/home1/xen-3.0-testing.hg/dist/install/usr/lib/python/xen/web/SrvBase.py", line 85, in perform return op_method(op, req) File "/home1/xen-3.0-testing.hg/dist/install/usr/lib/python/xen/xend/server/SrvDomain.py", line 72, in op_wait_for_devices return self.dom.waitForDevices() File "/home1/xen-3.0-testing.hg/dist/install/usr/lib/python/xen/xend/XendDomainInfo.py", line 1349, in waitForDevices self.waitForDevices_(c) File "/home1/xen-3.0-testing.hg/dist/install/usr/lib/python/xen/xend/XendDomainInfo.py", line 977, in waitForDevices_ return self.getDeviceController(deviceClass).waitForDevices() File "/home1/xen-3.0-testing.hg/dist/install/usr/lib/python/xen/xend/server/DevController.py", line 135, in waitForDevices return map(self.waitForDevice, self.deviceIDs()) File "/home1/xen-3.0-testing.hg/dist/install/usr/lib/python/xen/xend/server/DevController.py", line 151, in waitForDevice raise VmError("Device %s (%s) could not be connected. " VmError: Device 2049 (vbd) could not be connected. Backend device not found. The last line is the same error as what Rickard got. Taking his tip, i started to explore the command line options of create_cow to see if something was missing on my machine or not. Now guessing from the parameter options taken by create_cow and what is written in the block-cow file, i tried to execute this create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50 Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 Creating a device mapper device for /dev/loop100 Creating backing file 1+0 records in 1+0 records out Creating snapshot device-mapper ioctl cmd 9 failed: Invalid argument Command failed failed :( Also i see hanged up processed in memory of my attempts of cow usage root 3364 5 0 17:33 ? 00:00:00 /bin/sh /sbin/hotplug xen-backend root 3382 3364 0 17:33 ? 00:00:00 /bin/sh /etc/hotplug/xen- backend.agent root 3386 3382 0 17:33 ? 00:00:00 /bin/sh /etc/xen/scripts/block add root 3437 3386 0 17:33 ? 00:00:00 /bin/sh /etc/xen/scripts/block-cow add root 3497 1 0 17:33 ? 00:00:00 dmsetup create vm01sda1-master Any ideas on how to proceed now ? Thanks for all the help. -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-25 12:19 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On 1/25/06, Anand <xen.mails@gmail.com> wrote:> > create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50 > > Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 > Creating a device mapper device for /dev/loop100 > Creating backing file > 1+0 records in > 1+0 records out > Creating snapshot > device-mapper ioctl cmd 9 failed: Invalid argument > Command failed >Just wanted to add this when i tried to reboot the test machine, it was stuck and displayed an error stating that dm-snapshot requires 4 parameters. -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-25 22:45 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On looking further in the create_cow code, i see it does create /dev/mapper/[cow name] and creates entries in /tmp/cow_backing directory with some files in it. However it ends up with the same error and hung process of dmsetup in the memory. create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50> > > > Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 > > Creating a device mapper device for /dev/loop100 > > Creating backing file > > 1+0 records in > > 1+0 records out > > Creating snapshot > > device-mapper ioctl cmd 9 failed: Invalid argument > > Command failed > > >-- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Deegan
2006-Jan-26 10:39 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On Wed, Jan 25, 2006 at 05:44:09PM +0530, Anand wrote:> create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50 > > Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 > Creating a device mapper device for /dev/loop100 > Creating backing file > 1+0 records in > 1+0 records out > Creating snapshot > device-mapper ioctl cmd 9 failed: Invalid argument > Command failedWhat is the actual dmsetup command that fails? What''s the output of "bash -x /usr/sbin/create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50" ? Tim. -- Tim Deegan (My opinions, not the University''s) Systems Research Group University of Cambridge Computer Laboratory _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-26 13:46 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On 1/26/06, Tim Deegan <Tim.Deegan@cl.cam.ac.uk> wrote:> > What is the actual dmsetup command that fails? What''s the output of > "bash -x /usr/sbin/create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50" > ? >Here is the output. I used cent02 since cent01 was already present in /dev/mapper/ bash -x /usr/sbin/create_cow -i /root/xen/centos.4-2.img -n cent02 -s 50 + set -e + BACKING_DIR=/tmp/cow_backing + mkdir -p /tmp/cow_backing + getopts qhi:n:b:s: opt + case $opt in + SOURCE=/root/xen/centos.4-2.img + getopts qhi:n:b:s: opt + case $opt in + TARGET=cent02 + getopts qhi:n:b:s: opt + case $opt in + BACKING_SIZE=50 + getopts qhi:n:b:s: opt + ''['' -z /root/xen/centos.4-2.img -o -z cent02 -o -z 50 '']'' + check_prereq dmsetup + which dmsetup + check_prereq losetup + which losetup + check_prereq blockdev + which blockdev + dmsetup mknodes + ''['' -e /dev/mapper/cent02 -o -e /tmp/cow_backing/cent02-storage '']'' + ''['' -b /root/xen/centos.4-2.img '']'' + ''['' -f /root/xen/centos.4-2.img '']'' ++ find_free_loop_device +++ ls -1 /dev/loop0 /dev/loop1 /dev/loop10 /dev/loop100 /dev/loop101 /dev/loop102 /dev/loop103 /dev/loop104 /dev/loop105 /dev/loop106 /dev/loop107 /dev/loop108 /dev/loop109 /dev/loop11 /dev/loop110 /dev/loop111 /dev/loop112 /dev/loop113 /dev/loop114 /dev/loop115 /dev/loop116 /dev/loop117 /dev/loop118 /dev/loop119 /dev/loop12 /dev/loop120 /dev/loop121 /dev/loop122 /dev/loop123 /dev/loop124 /dev/loop125 /dev/loop126 /dev/loop127 /dev/loop13 /dev/loop14 /dev/loop15 /dev/loop16 /dev/loop17 /dev/loop18 /dev/loop19 /dev/loop2 /dev/loop20 /dev/loop21 /dev/loop22 /dev/loop23 /dev/loop24 /dev/loop25 /dev/loop26 /dev/loop27 /dev/loop28 /dev/loop29 /dev/loop3 /dev/loop30 /dev/loop31 /dev/loop32 /dev/loop33 /dev/loop34 /dev/loop35 /dev/loop36 /dev/loop37 /dev/loop38 /dev/loop39 /dev/loop4 /dev/loop40 /dev/loop41 /dev/loop42 /dev/loop43 /dev/loop44 /dev/loop45 /dev/loop46 /dev/loop47 /dev/loop48 /dev/loop49 /dev/loop5 /dev/loop50 /dev/loop51 /dev/loop52 /dev/loop53 /dev/loop54 /dev/loop55 /dev/loop56 /dev/loop57 /dev/loop58 /dev/loop59 /dev/loop6 /dev/loop60 /dev/loop61 /dev/loop62 /dev/loop63 /dev/loop64 /dev/loop65 /dev/loop66 /dev/loop67 /dev/loop68 /dev/loop69 /dev/loop7 /dev/loop70 /dev/loop71 /dev/loop72 /dev/loop73 /dev/loop74 /dev/loop75 /dev/loop76 /dev/loop77 /dev/loop78 /dev/loop79 /dev/loop8 /dev/loop80 /dev/loop81 /dev/loop82 /dev/loop83 /dev/loop84 /dev/loop85 /dev/loop86 /dev/loop87 /dev/loop88 /dev/loop89 /dev/loop9 /dev/loop90 /dev/loop91 /dev/loop92 /dev/loop93 /dev/loop94 /dev/loop95 /dev/loop96 /dev/loop97 /dev/loop98 /dev/loop99 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop0 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop1 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop10 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop100 ++ echo /dev/loop100 ++ return + SOURCE_DEVICE=/dev/loop100 + quiet echo ''Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100'' + ''['' -n '''' '']'' + eval echo Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 ++ echo Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 Putting /root/xen/centos.4-2.img onto loopback device /dev/loop100 + losetup /dev/loop100 /root/xen/centos.4-2.img + echo /dev/loop100 ++ blockdev --getsize /dev/loop100 + SOURCE_SIZE=2050048 + echo /dev/loop100 + grep -q /dev/mapper/ + quiet echo ''Creating a device mapper device for /dev/loop100'' + ''['' -n '''' '']'' + eval echo Creating a device mapper device for /dev/loop100 ++ echo Creating a device mapper device for /dev/loop100 Creating a device mapper device for /dev/loop100 + SOURCE_DM_DEVICE=cent02-master + echo ''0 2050048 linear /dev/loop100 0'' + dmsetup create cent02-master + echo cent02-master + ''['' -z '''' '']'' + quiet echo ''Creating backing file'' + ''['' -n '''' '']'' + eval echo Creating backing file ++ echo Creating backing file Creating backing file + BACKING_FILE=/tmp/cow_backing/cent02-storage + dd if=/dev/zero of=/tmp/cow_backing/cent02-storage bs=512 count=1 seek=102400 1+0 records in 1+0 records out ++ find_free_loop_device +++ ls -1 /dev/loop0 /dev/loop1 /dev/loop10 /dev/loop100 /dev/loop101 /dev/loop102 /dev/loop103 /dev/loop104 /dev/loop105 /dev/loop106 /dev/loop107 /dev/loop108 /dev/loop109 /dev/loop11 /dev/loop110 /dev/loop111 /dev/loop112 /dev/loop113 /dev/loop114 /dev/loop115 /dev/loop116 /dev/loop117 /dev/loop118 /dev/loop119 /dev/loop12 /dev/loop120 /dev/loop121 /dev/loop122 /dev/loop123 /dev/loop124 /dev/loop125 /dev/loop126 /dev/loop127 /dev/loop13 /dev/loop14 /dev/loop15 /dev/loop16 /dev/loop17 /dev/loop18 /dev/loop19 /dev/loop2 /dev/loop20 /dev/loop21 /dev/loop22 /dev/loop23 /dev/loop24 /dev/loop25 /dev/loop26 /dev/loop27 /dev/loop28 /dev/loop29 /dev/loop3 /dev/loop30 /dev/loop31 /dev/loop32 /dev/loop33 /dev/loop34 /dev/loop35 /dev/loop36 /dev/loop37 /dev/loop38 /dev/loop39 /dev/loop4 /dev/loop40 /dev/loop41 /dev/loop42 /dev/loop43 /dev/loop44 /dev/loop45 /dev/loop46 /dev/loop47 /dev/loop48 /dev/loop49 /dev/loop5 /dev/loop50 /dev/loop51 /dev/loop52 /dev/loop53 /dev/loop54 /dev/loop55 /dev/loop56 /dev/loop57 /dev/loop58 /dev/loop59 /dev/loop6 /dev/loop60 /dev/loop61 /dev/loop62 /dev/loop63 /dev/loop64 /dev/loop65 /dev/loop66 /dev/loop67 /dev/loop68 /dev/loop69 /dev/loop7 /dev/loop70 /dev/loop71 /dev/loop72 /dev/loop73 /dev/loop74 /dev/loop75 /dev/loop76 /dev/loop77 /dev/loop78 /dev/loop79 /dev/loop8 /dev/loop80 /dev/loop81 /dev/loop82 /dev/loop83 /dev/loop84 /dev/loop85 /dev/loop86 /dev/loop87 /dev/loop88 /dev/loop89 /dev/loop9 /dev/loop90 /dev/loop91 /dev/loop92 /dev/loop93 /dev/loop94 /dev/loop95 /dev/loop96 /dev/loop97 /dev/loop98 /dev/loop99 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop0 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop1 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop10 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop100 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop101 ++ echo /dev/loop101 ++ return + BACKING_DEVICE=/dev/loop101 + losetup /dev/loop101 /tmp/cow_backing/cent02-storage + echo /dev/loop101 + quiet echo ''Creating snapshot'' + ''['' -n '''' '']'' + eval echo Creating snapshot ++ echo Creating snapshot Creating snapshot + ''['' -n '']'' + dmsetup suspend cent02-master + echo ''0 2050048 snapshot /dev/mapper/cent02-master /dev/loop101 p 50'' + dmsetup create cent02 device-mapper ioctl cmd 9 failed: Invalid argument Command failed Looks like it fails at the dmsetup create line. -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-26 13:48 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
One more thing, if i used dmsetup to remove the earlier non successful cow instance names like cent01, it did remove it, however trying to use the cow script with the same name results in the process getting hanged up in memory, even Ctrl+C won''t break it. The only way would be to login to another console, kill the process. This is what i used to remove entries in /dev/mapper created by the dmsetup dmsetup remove cent01 dmsetup remove cent01-master -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Deegan
2006-Jan-26 14:03 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On Thu, Jan 26, 2006 at 07:16:32PM +0530, Anand wrote:> + echo ''0 2050048 snapshot /dev/mapper/cent02-master /dev/loop101 p 50'' > + dmsetup create cent02 > device-mapper ioctl cmd 9 failed: Invalid argument > Command failedOK, it looks like dmsetup is getting the right arguments. Do you have the dm-snapshot kernel module loaded? (lsmod |grep ''^dm'') Tim. -- Tim Deegan (My opinions, not the University''s) Systems Research Group University of Cambridge Computer Laboratory _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-26 15:57 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On 1/26/06, Tim Deegan <Tim.Deegan@cl.cam.ac.uk> wrote:> > OK, it looks like dmsetup is getting the right arguments. Do you have > the dm-snapshot kernel module loaded? (lsmod |grep ''^dm'') >[root@xen xen-3.0-testing.hg]# lsmod |grep ''^dm'' dm_mirror 24280 0 dm_mod 61152 2 dm_mirror Doesn''t look like so. Did a modprobe [root@xen xen-3.0-testing.hg]# modprobe dm_snapshot [root@xen xen-3.0-testing.hg]# lsmod |grep ''^dm'' dm_snapshot 19296 0 dm_mirror 24280 0 dm_mod 61152 3 dm_snapshot,dm_mirror Will try the create_cow now and post results. Thanks. -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-26 16:00 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
Still same error :( [root@xen ~]# bash -x /usr/sbin/create_cow -i /root/xen/centos.4-2.img -n cent01 -s 50 + set -e + BACKING_DIR=/tmp/cow_backing + mkdir -p /tmp/cow_backing + getopts qhi:n:b:s: opt + case $opt in + SOURCE=/root/xen/centos.4-2.img + getopts qhi:n:b:s: opt + case $opt in + TARGET=cent01 + getopts qhi:n:b:s: opt + case $opt in + BACKING_SIZE=50 + getopts qhi:n:b:s: opt + ''['' -z /root/xen/centos.4-2.img -o -z cent01 -o -z 50 '']'' + check_prereq dmsetup + which dmsetup + check_prereq losetup + which losetup + check_prereq blockdev + which blockdev + dmsetup mknodes + ''['' -e /dev/mapper/cent01 -o -e /tmp/cow_backing/cent01-storage '']'' + ''['' -b /root/xen/centos.4-2.img '']'' + ''['' -f /root/xen/centos.4-2.img '']'' ++ find_free_loop_device +++ ls -1 /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop0 ++ echo /dev/loop0 ++ return + SOURCE_DEVICE=/dev/loop0 + quiet echo ''Putting /root/xen/centos.4-2.img onto loopback device /dev/loop0'' + ''['' -n '''' '']'' + eval echo Putting /root/xen/centos.4-2.img onto loopback device /dev/loop0 ++ echo Putting /root/xen/centos.4-2.img onto loopback device /dev/loop0 Putting /root/xen/centos.4-2.img onto loopback device /dev/loop0 + losetup /dev/loop0 /root/xen/centos.4-2.img + echo /dev/loop0 ++ blockdev --getsize /dev/loop0 + SOURCE_SIZE=2050048 + echo /dev/loop0 + grep -q /dev/mapper/ + quiet echo ''Creating a device mapper device for /dev/loop0'' + ''['' -n '''' '']'' + eval echo Creating a device mapper device for /dev/loop0 ++ echo Creating a device mapper device for /dev/loop0 Creating a device mapper device for /dev/loop0 + SOURCE_DM_DEVICE=cent01-master + echo ''0 2050048 linear /dev/loop0 0'' + dmsetup create cent01-master + echo cent01-master + ''['' -z '''' '']'' + quiet echo ''Creating backing file'' + ''['' -n '''' '']'' + eval echo Creating backing file ++ echo Creating backing file Creating backing file + BACKING_FILE=/tmp/cow_backing/cent01-storage + dd if=/dev/zero of=/tmp/cow_backing/cent01-storage bs=512 count=1 seek=102400 1+0 records in 1+0 records out ++ find_free_loop_device +++ ls -1 /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop8 /dev/loop9 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop0 ++ for device in ''`ls -1 /dev/loop*`'' ++ losetup /dev/loop1 ++ echo /dev/loop1 ++ return + BACKING_DEVICE=/dev/loop1 + losetup /dev/loop1 /tmp/cow_backing/cent01-storage + echo /dev/loop1 + quiet echo ''Creating snapshot'' + ''['' -n '''' '']'' + eval echo Creating snapshot ++ echo Creating snapshot Creating snapshot + ''['' -n '']'' + dmsetup suspend cent01-master + echo ''0 2050048 snapshot /dev/mapper/cent01-master /dev/loop1 p 50'' + dmsetup create cent01 device-mapper ioctl cmd 9 failed: Invalid argument Command failed -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Deegan
2006-Jan-27 12:08 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On Thu, Jan 26, 2006 at 09:30:22PM +0530, Anand wrote:> Still same error :(> device-mapper ioctl cmd 9 failed: Invalid argument > Command failedIn that case I''m out of ideas. You might try the device-manager mailing lists. Tim. -- Tim Deegan (My opinions, not the University''s) Systems Research Group University of Cambridge Computer Laboratory _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-27 16:28 UTC
Re: [Xen-users] How was CoW implemented on the Demo LiveCD (3.0) ??
On 1/27/06, Tim Deegan <Tim.Deegan@cl.cam.ac.uk> wrote:> > > device-mapper ioctl cmd 9 failed: Invalid argument > > Command failed >In that case I''m out of ideas. You might try the device-manager mailing> lists. > >I found something on the mailing lists http://lists.xensource.com/archives/html/xen-users/2005-06/msg00440.html This works for the flat files, however it doesn''t work for the volumes. It gives the same error as i am getting with create_cow script for flat files. The difference what i see by just glancing over it, create_cow script + dmsetup suspend cent01-master + echo ''0 2050048 snapshot /dev/mapper/cent01-master /dev/loop1 p 50'' + dmsetup create cent01 working lines from the above post echo "0 $BLOCKSIZE snapshot /dev/mapper/rootfs_base /dev/loop1 p 8" \ | dmsetup create rootfs1 A difference of 50 and 8. What does this stand for any ideas ? Thanks for all the help. -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Molle Bestefich
2006-Jan-28 15:30 UTC
[Xen-users] Re: How was CoW implemented on the Demo LiveCD (3.0) ??
Tim Deegan wrote:> Anand wrote: > > device-mapper ioctl cmd 9 failed: Invalid argument > > Command failed > > OK, it looks like dmsetup is getting the right arguments.Hmm, how do you gather that? To me it looks like a case of the device mapper having changed the order and number of arguments. Not as a visible change in the arguments to the ''dmsetup'' executable mind you, but in how ''dmsetup'' communicates with the device mapper {kernel module,library}. "Anand", could you try ''dmsetup --version'' on both the LiveCD and your box and see if module and library version numbers match up? I don''t know how to get the version of the ''dmsetup'' executable itself, but you could try just cp''ing the one from the LiveCD. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Anand
2006-Jan-28 17:14 UTC
[Xen-users] Re: How was CoW implemented on the Demo LiveCD (3.0) ??
On 1/28/06, Molle Bestefich <molle.bestefich@gmail.com> wrote:> > Hmm, how do you gather that? > > To me it looks like a case of the device mapper having changed the > order and number of arguments. Not as a visible change in the > arguments to the ''dmsetup'' executable mind you, but in how ''dmsetup'' > communicates with the device mapper {kernel module,library}. > > "Anand", could you try ''dmsetup --version'' on both the LiveCD and your > box and see if module and library version numbers match up? > > I don''t know how to get the version of the ''dmsetup'' executable > itself, but you could try just cp''ing the one from the LiveCD. >Both of them report the same. dmsetup --version Library version: 1.01.04 (2005-08-02) Driver version: 4.4.0 -- regards, Anand _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users