Does anyone has e detailed procedure to change the size (ie increase) of the file that is used as the "xvda" disk by a domU? This is the file created by the "xenguest-install" script (or the one created as in section 6.2 of the xen user's manual for the file-backed VBDs scenario).
Thanks in advance
Yeah, you use LVM and grow you logical volume size, then expand it in the guest domain. I'm not sure, but I suspect you'd have to restart your guest before you can expand it.
On Apr 23, 2006, at 5:18 PM, Denis Forveille wrote:
Does anyone has e detailed procedure to change the size (ie increase) of the file that is used as the "xvda" disk by a domU? This is the file created by the "xenguest-install" script (or the one created as in section 6.2 of the xen user's manual for the file- backed VBDs scenario).
Thanks in advance
-- Fedora-xen mailing list Fedora-xen@redhat.com https://www.redhat.com/mailman/listinfo/fedora-xen
Ben wrote:
Yeah, you use LVM and grow you logical volume size, then expand it in the guest domain. I'm not sure, but I suspect you'd have to restart your guest before you can expand it.
But isn't the xvda just a file containing partitions and the like? I've actually been wanting to do this myself WITH LVM. I'd LOVE to have lvm extend the file itself.
I did find the trick extending an image: dd if=/dev/zero bs=1024 count=3500000 >> fedora.fc5.img resize2fs -f fedora.fc5.img
and thats works great...The way I understand the xvda file is that you'd have to copy out anything that is after the main image resize the image (like above) and then append the old stuff back to the end of the disk. I'd assume "stuff" here to mean something like swap.
Chris
Sorry, I should have been more clear. When you create the domU, you need to give it an LVM logical volume. As far as the domU is concerned, it's just a disk. But from the dom0 side, it's an easily expandible partition. After you grow it, use tools on the domU side to expand the filesystem.
There's really no point in trying to expand a swap partition because you can just make another one.
On Mon, 24 Apr 2006, Chris Hirsch wrote:
Ben wrote:
Yeah, you use LVM and grow you logical volume size, then expand it in the guest domain. I'm not sure, but I suspect you'd have to restart your guest before you can expand it.
But isn't the xvda just a file containing partitions and the like? I've actually been wanting to do this myself WITH LVM. I'd LOVE to have lvm extend the file itself.
I did find the trick extending an image: dd if=/dev/zero bs=1024 count=3500000 >> fedora.fc5.img resize2fs -f fedora.fc5.img
and thats works great...The way I understand the xvda file is that you'd have to copy out anything that is after the main image resize the image (like above) and then append the old stuff back to the end of the disk. I'd assume "stuff" here to mean something like swap.
Chris
On Mon, 2006-04-24 at 20:29 -0400, Denis Forveille wrote:
After that I'm stucked:
- I cant expand the filesystem for "/" from domU: "fdisk" gives the
correct (new) size for "/dev/xvda", but I can't use parted or rezise2fs on "/dev/xvda1" as it is mounted...
Take a look at ext2online for online resizing of ext[23] filesystems
- Maybe, from dom0, a combination of "lomount" and "parted" or
"resize2fs" or other tools could do the job but I don't know how to do it.
Take a look at kpartx (I think it's in the device-mapper-multipath package for whatever reason, but that's neither here nor there) -- it'll let you set up device mapper devices based on a partition table if you want to do manipulation of guest filesystems from dom0
Jeremy
Is anyone using FC5 Xen with an FC5 guest, where the Dom0 has two ethernet devices (succesfully)?
My system has eth0 as a 192.168.2.x network, eth1 as my static Internet address, and iptables NAT between them. All real machines on my home network can get out just fine.
My guest VM, also a 192.168.2.x address, is able to reach other machines on my internal network without problem, but trying to access the internet doesn't work. At first I thought it was an iptables configuration issue on the Dom0 machine, but I don't think so anymore. As a test, I inserted at the top of every table a rule to emit a log message when any machine on my net tried to access a specific remote host; performing a wget command in the guest VM shows my outbound SYN, shows an incoming SYN+ACK from the remote host (so outbound masquarading must be working?) and an outbound ACK (so incoming demasquarading must be working?)... I never receive another packet from the remote host (until quite a while later, when I receive FIN). If I try the same exercise with a real host on my network, I get a normal data stream in/out.
Also, traceroute from the guest VM doesn't work exactly as I would expect. I would expect the results of one to be quite similar to those from my Dom0 machine, but consistantly I am missing responses along the path. For example:
From dom0:
[root@heilpern ~]# traceroute www.yahoo.com traceroute to www.yahoo.com (216.109.117.106), 30 hops max, 40 byte packets 1 [my cable modem] 2 10.106.32.1 (10.106.32.1) 8.279 ms 11.786 ms * 3 * * * 4 * * * 5 * * * 6 * * * 7 ae-0-0.bbr2.Washington1.Level3.net (4.68.128.210) 45.855 ms * * 8 ae-21-54.car1.Washington1.Level3.net (4.68.121.114) 35.593 ms ae-21-56.car1.Washington1.Level3.net (4.68.121.178) 35.382 ms 41.539 ms 9 4.79.228.2 (4.79.228.2) 40.073 ms 39.931 ms * 10 * * * 11 * * * 12 * p21.www.dcn.yahoo.com (216.109.117.106) 35.227 ms *
From the guest VM:
[root@testvm ~]# traceroute www.yahoo.com traceroute to www.yahoo.com (216.109.117.106), 30 hops max, 40 byte packets 1 192.168.2.1 (192.168.2.1) 0.000 ms 0.000 ms 0.000 ms 2 [my cable modem] 3 10.106.32.1 (10.106.32.1) 9.910 ms 13.919 ms * 4 * * * 5 * * * 6 * * * 7 * * * 8 ae-0-0.bbr2.Washington1.Level3.net (4.68.128.210) 48.307 ms * * 9 ae-11-51.car1.Washington1.Level3.net (4.68.121.18) 37.938 ms 42.377 ms ae-21-54.car1.Washington1.Level3.net (4.68.121.114) 43.048 ms 10 4.79.228.2 (4.79.228.2) 45.568 ms 43.918 ms * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * 30 * * * [root@testvm ~]#
This is pretty repeatable.
Any thoughts?
Here are my Dom0 configurations: [root@heilpern ~]# brctl show bridge name bridge id STP enabled interfaces xenbr0 8000.feffffffffff no peth0 vif0.0 vif2.0 [root@heilpern ~]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:10:DC:F2:70:17 inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::210:dcff:fef2:7017/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:733780 errors:0 dropped:0 overruns:0 frame:0 TX packets:822036 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:87799449 (83.7 MiB) TX bytes:207088442 (197.4 MiB)
[root@heilpern ~]# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:90:47:03:B8:63 inet addr:[my IP] Bcast:[my BCAST IP] Mask:255.255.255.252 inet6 addr: fe80::290:47ff:fe03:b863/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:829216 errors:0 dropped:0 overruns:0 frame:0 TX packets:556902 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:169446616 (161.5 MiB) TX bytes:85050877 (81.1 MiB) Interrupt:18
[root@heilpern ~]# iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination
Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT) target prot opt source destination
(temporary wide-open rules): [root@heilpern ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination
Chain FORWARD (policy ACCEPT) target prot opt source destination
Chain OUTPUT (policy ACCEPT) target prot opt source destination
Chain INBOUND (0 references) target prot opt source destination
Chain LOG_FILTER (0 references) target prot opt source destination
Chain LSI (0 references) target prot opt source destination
Chain LSO (0 references) target prot opt source destination
Chain OUTBOUND (0 references) target prot opt source destination
Thanks in advance... Mark
Yes, but not with the default xen bridging scripts.
On Apr 24, 2006, at 6:27 PM, Mark A Heilpern wrote:
Is anyone using FC5 Xen with an FC5 guest, where the Dom0 has two ethernet devices (succesfully)?
My system has eth0 as a 192.168.2.x network, eth1 as my static Internet address, and iptables NAT between them. All real machines on my home network can get out just fine.
My guest VM, also a 192.168.2.x address, is able to reach other machines on my internal network without problem, but trying to access the internet doesn't work. At first I thought it was an iptables configuration issue on the Dom0 machine, but I don't think so anymore. As a test, I inserted at the top of every table a rule to emit a log message when any machine on my net tried to access a specific remote host; performing a wget command in the guest VM shows my outbound SYN, shows an incoming SYN+ACK from the remote host (so outbound masquarading must be working?) and an outbound ACK (so incoming demasquarading must be working?)... I never receive another packet from the remote host (until quite a while later, when I receive FIN). If I try the same exercise with a real host on my network, I get a normal data stream in/out.
Also, traceroute from the guest VM doesn't work exactly as I would expect. I would expect the results of one to be quite similar to those from my Dom0 machine, but consistantly I am missing responses along the path. For example:
From dom0:
[root@heilpern ~]# traceroute www.yahoo.com traceroute to www.yahoo.com (216.109.117.106), 30 hops max, 40 byte packets 1 [my cable modem] 2 10.106.32.1 (10.106.32.1) 8.279 ms 11.786 ms * 3 * * * 4 * * * 5 * * * 6 * * * 7 ae-0-0.bbr2.Washington1.Level3.net (4.68.128.210) 45.855 ms * * 8 ae-21-54.car1.Washington1.Level3.net (4.68.121.114) 35.593 ms ae-21-56.car1.Washington1.Level3.net (4.68.121.178) 35.382 ms 41.539 ms 9 4.79.228.2 (4.79.228.2) 40.073 ms 39.931 ms * 10 * * * 11 * * * 12 * p21.www.dcn.yahoo.com (216.109.117.106) 35.227 ms *
From the guest VM:
[root@testvm ~]# traceroute www.yahoo.com traceroute to www.yahoo.com (216.109.117.106), 30 hops max, 40 byte packets 1 192.168.2.1 (192.168.2.1) 0.000 ms 0.000 ms 0.000 ms 2 [my cable modem] 3 10.106.32.1 (10.106.32.1) 9.910 ms 13.919 ms * 4 * * * 5 * * * 6 * * * 7 * * * 8 ae-0-0.bbr2.Washington1.Level3.net (4.68.128.210) 48.307 ms * * 9 ae-11-51.car1.Washington1.Level3.net (4.68.121.18) 37.938 ms 42.377 ms ae-21-54.car1.Washington1.Level3.net (4.68.121.114) 43.048 ms 10 4.79.228.2 (4.79.228.2) 45.568 ms 43.918 ms * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * 30 * * * [root@testvm ~]#
This is pretty repeatable.
Any thoughts?
Here are my Dom0 configurations: [root@heilpern ~]# brctl show bridge name bridge id STP enabled interfaces xenbr0 8000.feffffffffff no peth0 vif0.0 vif2.0 [root@heilpern ~]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:10:DC:F2:70:17 inet addr:192.168.2.1 Bcast:192.168.2.255 Mask: 255.255.255.0 inet6 addr: fe80::210:dcff:fef2:7017/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:733780 errors:0 dropped:0 overruns:0 frame:0 TX packets:822036 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:87799449 (83.7 MiB) TX bytes:207088442 (197.4 MiB)
[root@heilpern ~]# ifconfig eth1 eth1 Link encap:Ethernet HWaddr 00:90:47:03:B8:63 inet addr:[my IP] Bcast:[my BCAST IP] Mask:255.255.255.252 inet6 addr: fe80::290:47ff:fe03:b863/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:829216 errors:0 dropped:0 overruns:0 frame:0 TX packets:556902 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:169446616 (161.5 MiB) TX bytes:85050877 (81.1 MiB) Interrupt:18
[root@heilpern ~]# iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination
Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT) target prot opt source destination
(temporary wide-open rules): [root@heilpern ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination
Chain FORWARD (policy ACCEPT) target prot opt source destination
Chain OUTPUT (policy ACCEPT) target prot opt source destination
Chain INBOUND (0 references) target prot opt source destination
Chain LOG_FILTER (0 references) target prot opt source destination
Chain LSI (0 references) target prot opt source destination
Chain LSO (0 references) target prot opt source destination
Chain OUTBOUND (0 references) target prot opt source destination
Thanks in advance... Mark
-- Fedora-xen mailing list Fedora-xen@redhat.com https://www.redhat.com/mailman/listinfo/fedora-xen
Thanks, but I still miss how to grow the partition inside the disk inside the lvg (lvg -> /dev/xvda -> /dev/xvda1)
To summarize, the steps should be (from dom0): 1) grow the lvg used for domU (=/dev/xvda from the domU point of view) -> lvextend -L +1024 /dev/vg_domU/lv_FC55 2) grow the partition used by "/" in the lvg (/dev/xvda1) with parted -> parted /dev/mapper/vg_domU-lv_FC55 -> resize 1 32kB 9664MB (This does not work, see below) 3) resize the fs with resize2fs (from dom0) or with ext2online from domU (thanks to Jeremy) -> resize2fs /dev/mapper/vg_domU-lv_FC55
Here's the output from parted: Using /dev/mapper/vg_domU-lv_FC55 (parted) print Disk geometry for /dev/mapper/vg_domU-lv_FC55: 0kB - 9664MB Disk label type: msdos Number Start End Size Type File system Flags 1 32kB 8587MB 8587MB primary ext3 boot (parted) resize 1 Start? [32kB]? 32kB End? [8587MB]? 9660MB Error: File system has an incompatible feature enabled.
Is there a tool other than parted I could use to resize the partition /dev/xvda1 inside the lvg?
Jeremy Katz wrote:
On Mon, 2006-04-24 at 20:29 -0400, Denis Forveille wrote:
After that I'm stucked:
- I cant expand the filesystem for "/" from domU: "fdisk" gives the
correct (new) size for "/dev/xvda", but I can't use parted or rezise2fs on "/dev/xvda1" as it is mounted...
Take a look at ext2online for online resizing of ext[23] filesystems
- Maybe, from dom0, a combination of "lomount" and "parted" or
"resize2fs" or other tools could do the job but I don't know how to do it.
Take a look at kpartx (I think it's in the device-mapper-multipath package for whatever reason, but that's neither here nor there) -- it'll let you set up device mapper devices based on a partition table if you want to do manipulation of guest filesystems from dom0
Jeremy
-- Fedora-xen mailing list Fedora-xen@redhat.com https://www.redhat.com/mailman/listinfo/fedora-xen
On Monday 24 April 2006 06:41pm, Jeremy Katz wrote:
On Mon, 2006-04-24 at 20:29 -0400, Denis Forveille wrote:
After that I'm stucked:
- I cant expand the filesystem for "/" from domU: "fdisk" gives the
correct (new) size for "/dev/xvda", but I can't use parted or rezise2fs on "/dev/xvda1" as it is mounted...
Take a look at ext2online for online resizing of ext[23] filesystems
Is ext2online supposed to work for ext2 filesystems? I have read that it only worked for ext3. I've tried it with ext2 (created using mke2fs on RHEL4) and it never worked.
[snip]
On Monday 24 April 2006 08:45pm, Denis Forveille wrote:
Thanks, but I still miss how to grow the partition inside the disk inside the lvg (lvg -> /dev/xvda -> /dev/xvda1)
I don't have partitions inside of the LVs in dom0. It works great for all distros (SUSE 9.x/10.0, SLES8/9, RHEL3/4, CentOS3/4, FC2/3/4/5, Gentoo, Ubuntu). Just make the LV the partition for the domU guests. Then, you don't have to worry about a partition table from either dom0 or domU and the guests don't care about it either.
[snip]
On Tue, 2006-04-25 at 11:14 -0600, Lamont R. Peterson wrote:
On Monday 24 April 2006 06:41pm, Jeremy Katz wrote:
On Mon, 2006-04-24 at 20:29 -0400, Denis Forveille wrote:
After that I'm stucked:
- I cant expand the filesystem for "/" from domU: "fdisk" gives the
correct (new) size for "/dev/xvda", but I can't use parted or rezise2fs on "/dev/xvda1" as it is mounted...
Take a look at ext2online for online resizing of ext[23] filesystems
Is ext2online supposed to work for ext2 filesystems? I have read that it only worked for ext3. I've tried it with ext2 (created using mke2fs on RHEL4) and it never worked.
I thought the support went in, but I could be mistaken. As it turns out, I never create ext2 filesystems anymore :)
Jeremy
Okay... I think I've figured out how to do this..
Problem: I created a volume backed DomU on a 3G logical volume. The DomU itself used LVM to manage disks. I needed to expand the disk (i.e., the LVM on the Dom0).
The previous workaround was to add another LV in the Dom0 and assign it to the DomU. This created a second xvdb in the domU. I used standard LVM tools to create a PV and assign it to the original volume group. E.g.:
My xm-fc5-005 initially contained: name = "xm-fc5-005" memory = "256" disk = [ 'phy:/dev/rootvg/xm-fc4-005_lv,xvda,w'] vif = [ 'mac=00:16:3e:20:48:ae' ] bootloader="/usr/bin/pygrub"
I added another disk by creating a new LV in dom0 and assigning with:
disk = [ 'phy:/dev/rootvg/xm-fc4-005_lv,xvda,w',\ 'phy:/dev/rootvg/xm-fc5-005_lv2,xvdb,w' ]
The above works fine, and is probably no less efficient than the method that follows, but it felt kind of kludgey to add space that way. The second method is to lvresize the original VBD and use pvresize in the domU:
lvresize -L +1G /dev/rootvg/xm-fc4-005_lv
Then in the domU: First, determine the PV device by running pvdisplay and getting the PV Name. In this case, xvda2. Next resize it:
pvresize --setphysicalvolumesize 4G /dev/xvda2
pvresize appears to only be available in FC5... alas.
If you're not running LVMs inside the domU, you'd use parted (or qparted) to resize.