Re: [CentOS-virt] Best practices for LVM and virtualization

2010-02-10 Thread Manuel Wolfshant
Mathieu Baudier wrote:
 3. On both host and guest
   
 This is what I always use and recommend. It doesn't have any side effects 
 with modern software versions, except with layered
 

 Thanks!

 I have tried this, but I don't see how to grow the guest file system
 without restarting the guest:
 - if I grow the underlying logical volume on the host, the guest still
 see the hard drive with the old size (checking with fdisk)
 - if I would add additional logical volumes (host) / drives (guest) in
 order to add them to the guest volume group, I will have to restart
 the guest

 I am using virtio disks.

 Is there a command so that the guest notices that its harddrive has grown?
 Is there a way to add new drives without restarting the guest?
yes, you can add / remove disks to a VM without restarting the guest. 
look at the xm block-attach  / block-detach commands
___
CentOS-virt mailing list
CentOS-virt@centos.org
http://lists.centos.org/mailman/listinfo/centos-virt


Re: [CentOS-virt] Best practices for LVM and virtualization

2010-02-10 Thread Mathieu Baudier
 yes, you can add / remove disks to a VM without restarting the guest.
 look at the xm block-attach  / block-detach commands

My understanding is that xm is Xen specific (I'm using Qemu/KVM)

I tried with virsh:

virsh # attach-disk 6 /dev/mapper/vg_alma_fast-lv_test_virtlvm2 vdb
Disk attached successfully

virsh # dumpxml 6
domain type='kvm' id='6'
...
  devices
emulator/usr/libexec/qemu-kvm/emulator
...
disk type='block' device='disk'
  source dev='/dev/mapper/vg_alma_fast-lv_test_virtlvm'/
  target dev='vda' bus='virtio'/
/disk
disk type='block' device='disk'
  driver name='phy'/
  source dev='/dev/mapper/vg_alma_fast-lv_test_virtlvm2'/
  target dev='vdb' bus='virtio'/
/disk
...
  /devices
/domain

But I still cannot see the disk using fdisk: there is no /dev/vdb.

Please note that I'm testing with a minimal CentOS installation
(without even the Base group).
So maybe it lacks some required deamons (there is no ACPI deamon for exmaple).

I will try again with an install including the Base group.
___
CentOS-virt mailing list
CentOS-virt@centos.org
http://lists.centos.org/mailman/listinfo/centos-virt


Re: [CentOS-virt] Best practices for LVM and virtualization

2010-02-10 Thread Manuel Wolfshant
Mathieu Baudier wrote:
 yes, you can add / remove disks to a VM without restarting the guest.
 look at the xm block-attach  / block-detach commands
 

 My understanding is that xm is Xen specific (I'm using Qemu/KVM)

 I tried with virsh:

 virsh # attach-disk 6 /dev/mapper/vg_alma_fast-lv_test_virtlvm2 vdb
 Disk attached successfully

 virsh # dumpxml 6
 domain type='kvm' id='6'
 ...
   devices
 emulator/usr/libexec/qemu-kvm/emulator
 ...
 disk type='block' device='disk'
   source dev='/dev/mapper/vg_alma_fast-lv_test_virtlvm'/
   target dev='vda' bus='virtio'/
 /disk
 disk type='block' device='disk'
   driver name='phy'/
   source dev='/dev/mapper/vg_alma_fast-lv_test_virtlvm2'/
   target dev='vdb' bus='virtio'/
 /disk
 ...
   /devices
 /domain

 But I still cannot see the disk using fdisk: there is no /dev/vdb.

   
You also need to tell the guest that a new device exists... Unless it 
(the guest) has some hotswap abilities
___
CentOS-virt mailing list
CentOS-virt@centos.org
http://lists.centos.org/mailman/listinfo/centos-virt


Re: [CentOS-virt] Best practices for LVM and virtualization

2010-02-10 Thread Mathieu Baudier
 You also need to tell the guest that a new device exists... Unless it
 (the guest) has some hotswap abilities

Do you know how I can do that?

I reinstalled the guest (CentOS 5.4 x86_64, just as the host) with the
default non-desktop groups, but it still doesn't see when I attach a
disk.

I also try to disable SELinux, to no effect.

I've googling intensively around the concept of hotplug, hotswap, PCI,
HAL, etc. in relation to virsh/KVM/virtio but withotu success.

On the guest, lspci only shows on drive (the initial one I guess):

[r...@localhost ~]# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB Controller: Intel Corporation 82371SB PIIX3 USB
[Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Qumranet, Inc. Virtio network device
00:04.0 SCSI storage controller: Qumranet, Inc. Virtio block device
00:05.0 RAM memory: Qumranet, Inc. Virtio memory balloon
___
CentOS-virt mailing list
CentOS-virt@centos.org
http://lists.centos.org/mailman/listinfo/centos-virt


Re: [CentOS-virt] Best practices for LVM and virtualization

2010-02-10 Thread Manuel Wolfshant
Mathieu Baudier wrote:
 You also need to tell the guest that a new device exists... Unless it
 (the guest) has some hotswap abilities
 

 Do you know how I can do that?
   
something along

  echo - - -  /sys/class/scsi_host/hostX/scan  // yes, the - 
must be there !

might help


 I reinstalled the guest (CentOS 5.4 x86_64, just as the host) with the
 default non-desktop groups, but it still doesn't see when I attach a
 disk.

 I also try to disable SELinux, to no effect.

 I've googling intensively around the concept of hotplug, hotswap, PCI,
 HAL, etc. in relation to virsh/KVM/virtio but withotu success.

 On the guest, lspci only shows on drive (the initial one I guess):

 [r...@localhost ~]# lspci
 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
 00:01.2 USB Controller: Intel Corporation 82371SB PIIX3 USB
 [Natoma/Triton II] (rev 01)
 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
 00:02.0 VGA compatible controller: Cirrus Logic GD 5446
 00:03.0 Ethernet controller: Qumranet, Inc. Virtio network device
 00:04.0 SCSI storage controller: Qumranet, Inc. Virtio block device
 00:05.0 RAM memory: Qumranet, Inc. Virtio memory balloon
 ___
 CentOS-virt mailing list
 CentOS-virt@centos.org
 http://lists.centos.org/mailman/listinfo/centos-virt
   


-- 
 Manuel Wolfshant   linux registered user #131416
IT managerNoBug Consulting SRL
  A: Yes.
  Q: Are you sure?
  A: Because it reverses the logical flow of conversation.
  Q: Why is top posting frowned upon? 

___
CentOS-virt mailing list
CentOS-virt@centos.org
http://lists.centos.org/mailman/listinfo/centos-virt


Re: [CentOS-virt] Best practices for LVM and virtualization

2010-02-10 Thread Mathieu Baudier
 something along

          echo - - -  /sys/class/scsi_host/hostX/scan  // yes, the -
 must be there !

Unfortunately there is nothing under scsi:

[r...@localhost ~]# ll /sys/class/scsi_*
/sys/class/scsi_device:
total 0

/sys/class/scsi_disk:
total 0

/sys/class/scsi_host:
total 0

I also tried kudzu (http://linux.die.net/man/8/kudzu), but it still
shows only the original drive:

[r...@localhost ~]# kudzu
[r...@localhost ~]# kudzu -p
...
-
class: HD
bus: VIRTIO
detached: 0
device: vda
driver: virtio_blk
desc: Virtio Block Device
-
...

While looking around I found this comment (in a bug not directly related):

Yaniv Kaul  2009-05-19 06:53:14 EDT
Hot-add is not supported for RHEV 2.1.

https://bugzilla.redhat.com/show_bug.cgi?id=501468#c1

So maybe it actually cannot work?
___
CentOS-virt mailing list
CentOS-virt@centos.org
http://lists.centos.org/mailman/listinfo/centos-virt