[libvirt] KVM Windows guest: add hard drive

Manao ahoana, Hello, Bonjour, I installed a Windows (XP and 2003) guest using one partition as hard drive. I used: sudo virt-install --connect qemu:///system \ --name win2003-01 \ --ram 1024 \ --keymap=fr \ --disk path=/dev/lvm0/win2003-01 \ --cdrom=/home/mihamina/Windows_2003_Server.iso \ --os-type windows \ --os-variant=win2k3 \ --noapic \ --noacpi \ --network=bridge:br0 \ --accelerate \ --vnc \ --force And this works fine. Really fine. The disk section in the definition: <disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk> After installation, people asked me to add another hard drive to this installation, and then, I added another "disk" in the definition: <disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk> <disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01-a'/> <target dev='hdb' bus='ide'/> </disk> I destroyed + undefined + defined + started the VM and the definition is OK (dumpxml), but the Windows guest doesnt see any new hard drive. I already tried with replacing "ide" with "virtio", no new hard drive yet. This is my configuration: mihamina@kvm-lxc-02:~$ dpkg -l | grep "virt" ii kvm 72+dfsg-5~lenny5 Full virtualization on x86 hardware ii libvirt-bin 0.4.6-10 the programs for the libvirt library ii libvirt0 0.4.6-10 library for interfacing with different virtualization systems ii python-libvirt 0.4.6-10 libvirt Python bindings ii virt-manager 0.6.0-6 desktop application for managing virtual machines ii virt-viewer 0.0.3-2 Displaying the graphical console of a virtual machine ii virtinst 0.400.0-7 Programs to create and clone virtual machines How to make, with this, new hard drive recognized by the Windows guest? Misaotra, Thanks, Merci. -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 56 000 19

----- Original Message -----
From: "Mihamina Rakotomandimby" <mihamina@gulfsat.mg> To: virt-tools-list@redhat.com, "Libvirt Developers Mailing List" <libvir-list@redhat.com> Sent: Tuesday, October 12, 2010 2:17:49 PM Subject: [libvirt] KVM Windows guest: add hard drive Manao ahoana, Hello, Bonjour,
I installed a Windows (XP and 2003) guest using one partition as hard drive. I used:
sudo virt-install --connect qemu:///system \ --name win2003-01 \ --ram 1024 \ --keymap=fr \ --disk path=/dev/lvm0/win2003-01 \ --cdrom=/home/mihamina/Windows_2003_Server.iso \ --os-type windows \ --os-variant=win2k3 \ --noapic \ --noacpi \ --network=bridge:br0 \ --accelerate \ --vnc \ --force
And this works fine. Really fine.
The disk section in the definition:
<disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk>
After installation, people asked me to add another hard drive to this installation, and then, I added another "disk" in the definition:
<disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk> <disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01-a'/> <target dev='hdb' bus='ide'/> </disk>
I destroyed + undefined + defined + started the VM and the definition is OK (dumpxml), but the Windows guest doesnt see any new hard drive.
I already tried with replacing "ide" with "virtio", no new hard drive yet.
This is my configuration: mihamina@kvm-lxc-02:~$ dpkg -l | grep "virt" ii kvm 72+dfsg-5~lenny5 Full virtualization on x86 hardware ii libvirt-bin 0.4.6-10 the programs for the libvirt library ii libvirt0 0.4.6-10 library for interfacing with different virtualization systems ii python-libvirt 0.4.6-10 libvirt Python bindings ii virt-manager 0.6.0-6 desktop application for managing virtual machines ii virt-viewer 0.0.3-2 Displaying the graphical console of a virtual machine ii virtinst 0.400.0-7 Programs to create and clone virtual machines
How to make, with this, new hard drive recognized by the Windows guest?
Are you looking for a new driver to appear in 'my computer', because it wouldn't appear there until you format it. Does it show up in device manager?
Misaotra, Thanks, Merci.
--
Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 56 000 19
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

acathrow@redhat.com : Are you looking for a new driver to appear in 'my computer'
Yes, that is what I expected.
because it wouldn't appear there until you format it. Does it show up in device manager?
I'll try to see in the device manager and see if I can ask for formatting from somewhere. -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 56 000 19

On Wed, Oct 13, 2010 at 05:54:00AM +0300, Mihamina Rakotomandimby wrote:
acathrow@redhat.com : Are you looking for a new driver to appear in 'my computer'
Yes, that is what I expected.
because it wouldn't appear there until you format it. Does it show up in device manager?
I'll try to see in the device manager and see if I can ask for formatting from somewhere.
You could also try partitioning and preformatting the drive before you add it. _Shut down_ the virtual machine, then do: guestfish -a /dev/lvm0/win2003-01-a <<EOF run part-disk /dev/sda mbr mkfs ntfs /dev/sda1 EOF Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

On Wed, Oct 13, 2010 at 01:25:25PM +0100, Richard W.M. Jones wrote:
On Wed, Oct 13, 2010 at 05:54:00AM +0300, Mihamina Rakotomandimby wrote:
acathrow@redhat.com : Are you looking for a new driver to appear in 'my computer'
Yes, that is what I expected.
because it wouldn't appear there until you format it. Does it show up in device manager?
I'll try to see in the device manager and see if I can ask for formatting from somewhere.
You could also try partitioning and preformatting the drive before you add it. _Shut down_ the virtual machine, then do:
guestfish -a /dev/lvm0/win2003-01-a <<EOF run part-disk /dev/sda mbr mkfs ntfs /dev/sda1 EOF
In case it's not clear, those commands will delete all data on '/dev/lvm0/win2003-01-a'. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

On Tue, Oct 12, 2010 at 11:47 PM, Mihamina Rakotomandimby <mihamina@gulfsat.mg> wrote:
Manao ahoana, Hello, Bonjour,
I installed a Windows (XP and 2003) guest using one partition as hard drive. I used:
sudo virt-install --connect qemu:///system \ --name win2003-01 \ --ram 1024 \ --keymap=fr \ --disk path=/dev/lvm0/win2003-01 \ --cdrom=/home/mihamina/Windows_2003_Server.iso \ --os-type windows \ --os-variant=win2k3 \ --noapic \ --noacpi \ --network=bridge:br0 \ --accelerate \ --vnc \ --force
And this works fine. Really fine.
The disk section in the definition:
<disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk>
After installation, people asked me to add another hard drive to this installation, and then, I added another "disk" in the definition:
<disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk> <disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01-a'/> <target dev='hdb' bus='ide'/> </disk>
I am following this thread for my information want to know is the above syntax of adding a disk to vm definition correct? I have not tried it hence want to know. On Wed, Oct 13, 2010 at 5:55 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Wed, Oct 13, 2010 at 05:54:00AM +0300, Mihamina Rakotomandimby wrote:
acathrow@redhat.com : Are you looking for a new driver to appear in 'my computer'
Yes, that is what I expected.
because it wouldn't appear there until you format it. Does it show up in device manager?
I'll try to see in the device manager and see if I can ask for formatting from somewhere.
You could also try partitioning and preformatting the drive before you add it. _Shut down_ the virtual machine, then do:
guestfish -a /dev/lvm0/win2003-01-a <<EOF run part-disk /dev/sda mbr mkfs ntfs /dev/sda1 EOF Are you suggesting to erase mbr also? The guy is adding another disk to his vm so why does one need to erase mbr in vm?
partdisk is not installed on my system. Are you suggesting this utility http://support.microsoft.com/kb/896528

On Sat, Oct 16, 2010 at 06:55:13PM +0530, Tapas Mishra wrote:
On Tue, Oct 12, 2010 at 11:47 PM, Mihamina Rakotomandimby <mihamina@gulfsat.mg> wrote:
Manao ahoana, Hello, Bonjour,
I installed a Windows (XP and 2003) guest using one partition as hard drive. I used:
sudo virt-install --connect qemu:///system \ --name win2003-01 \ --ram 1024 \ --keymap=fr \ --disk path=/dev/lvm0/win2003-01 \ --cdrom=/home/mihamina/Windows_2003_Server.iso \ --os-type windows \ --os-variant=win2k3 \ --noapic \ --noacpi \ --network=bridge:br0 \ --accelerate \ --vnc \ --force
And this works fine. Really fine.
The disk section in the definition:
<disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk>
After installation, people asked me to add another hard drive to this installation, and then, I added another "disk" in the definition:
<disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01'/> <target dev='hda' bus='ide'/> </disk> <disk type='block' device='disk'> <source dev='/dev/lvm0/win2003-01-a'/> <target dev='hdb' bus='ide'/> </disk>
I am following this thread for my information want to know is the above syntax of adding a disk to vm definition correct? I have not tried it hence want to know.
Looks like it. If you get a specific error message, then we can help, otherwise we can't.
On Wed, Oct 13, 2010 at 5:55 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Wed, Oct 13, 2010 at 05:54:00AM +0300, Mihamina Rakotomandimby wrote:
acathrow@redhat.com : Are you looking for a new driver to appear in 'my computer'
Yes, that is what I expected.
because it wouldn't appear there until you format it. Does it show up in device manager?
I'll try to see in the device manager and see if I can ask for formatting from somewhere.
You could also try partitioning and preformatting the drive before you add it. _Shut down_ the virtual machine, then do:
guestfish -a /dev/lvm0/win2003-01-a <<EOF run part-disk /dev/sda mbr mkfs ntfs /dev/sda1 EOF
Are you suggesting to erase mbr also?
I was assuming that the new disk was completely blank, in which case creating a partition table and a filesystem inside that partition might be helpful.
The guy is adding another disk to his vm so why does one need to erase mbr in vm?
partdisk is not installed on my system. Are you suggesting this utility http://support.microsoft.com/kb/896528
No, I'm suggesting this utility: http://libguestfs.org/guestfish.1.html Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw

On Sat, Oct 16, 2010 at 06:55:13PM +0530, Tapas Mishra wrote:
Richard Jones wrote:
guestfish -a /dev/lvm0/win2003-01-a <<EOF run part-disk /dev/sda mbr mkfs ntfs /dev/sda1 EOF
Are you suggesting to erase mbr also? The guy is adding another disk to his vm so why does one need to erase mbr in vm?
OK, I see your confusion. When you add disks to libguestfs, they appear as /dev/sda, /dev/sdb and so on, in the same order that you added them. In this case I added one disk, 'guestfish -a /dev/lvm0/win2003-01-a', which will appear in libguestfs as /dev/sda. This is *not* the same as /dev/sda in a VM. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v
participants (4)
-
Andrew Cathrow
-
Mihamina Rakotomandimby
-
Richard W.M. Jones
-
Tapas Mishra