[libvirt] [Sheepdog][Libvirt]Test boot VMs from sheepdog volumes in Libvirt

Hi all, We can get "Boot VMs from sheepdog volumes in Libvirt" way from https://github.com/collie/sheepdog/wiki/Libvirt like following. a, prepare a file containing an XML domain description $ cat > sheepdog.xml <domain type='qemu'> <name>testvm</name> <memory>1048576</memory> <os> <type arch='x86_64'>hvm</type> </os> <devices> <disk type='network'> <source protocol="sheepdog" name="testvdi"/> <target dev='hda' bus='ide'/> </disk> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain> b, boot from testvdi with virsh $ virsh create sheepdog.xml c, connect to a VNC console of the running VM $ vncviewer localhost I have some following questions about up three steps. 1, Before a or b(up boot step) step, should we have to install our OS into 'testvdi'? That is to say, we have to install OS from os.iso file into 'testvdi', which should use 'qemu-system-x86_64' command to install OS, right? 2, Before this test, shoul we have to build Sheepdog, QEMU, Libvirt environment? 3, This is the storage online management in Libvirt, right? 4, This test just test the codes Morita take a patch named "add network disk support" for Libvirt, which is located here: http://libvirt.org/git/?p=libvirt.git;a=commit;h=036ad5052b43fe9f0d197e89fd1... and also test Sheepdog driver for QEMU, right? 5, If i installed a 32bits OS to testvdi, should i modify <os> <type arch='x86_64'>hvm</type> </os> to be <os> <type arch='x86'>hvm</type> </os> , right? 6, The step c (up boot step), which is $ vncviewer localhost Actually, i am not clear about this 'localhost'. Why should we link localhost but other ip addresses? Could anyone please give me some suggestions? Thanks in advance ;-) -- Thanks Harry Wei

2013/2/1 harryxiyou <harryxiyou@gmail.com>
Hi all,
We can get "Boot VMs from sheepdog volumes in Libvirt" way from https://github.com/collie/sheepdog/wiki/Libvirt like following.
a, prepare a file containing an XML domain description
$ cat > sheepdog.xml <domain type='qemu'> <name>testvm</name> <memory>1048576</memory> <os> <type arch='x86_64'>hvm</type> </os> <devices> <disk type='network'> <source protocol="sheepdog" name="testvdi"/> <target dev='hda' bus='ide'/> </disk> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain>
b, boot from testvdi with virsh
$ virsh create sheepdog.xml
c, connect to a VNC console of the running VM
$ vncviewer localhost
I have some following questions about up three steps.
1, Before a or b(up boot step) step, should we have to install our OS into 'testvdi'?
As I know, you should install an OS in the disk,or cannot boot from a 'NULL' disk.you know what i mean.
That is to say, we have to install OS from os.iso file into 'testvdi', which should use 'qemu-system-x86_64' command to install OS, right?
To install an OS, you could use 'virt-install' ,or use the virt-manager GUI tool.
2, Before this test, shoul we have to build Sheepdog, QEMU, Libvirt environment?
Yes, you must build the environment,either from source codes or from packages.
3, This is the storage online management in Libvirt, right?
later version of libvirt support managing sheepdog storage,use may have a search at libvirt.org.
4, This test just test the codes Morita take a patch named "add network disk support" for Libvirt, which is located here:
http://libvirt.org/git/?p=libvirt.git;a=commit;h=036ad5052b43fe9f0d197e89fd1... and also test Sheepdog driver for QEMU, right?
I think just test libvirt environment..
5, If i installed a 32bits OS to testvdi, should i modify
<os> <type arch='x86_64'>hvm</type> </os> to be <os> <type arch='x86'>hvm</type> </os> , right?
If arch='x86_64', then this configuration support both x86 and x64.
6, The step c (up boot step), which is $ vncviewer localhost Actually, i am not clear about this 'localhost'. Why should we link localhost but other ip addresses?
As localhost allways singed to 127.0.0.1 ,or you can use 127.0.0.1 instead of a name like 'locallhost'. Could anyone please give me some suggestions? Thanks in advance ;-)
-- Thanks Harry Wei -- sheepdog-users mailing lists sheepdog-users@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog-users

On Fri, Feb 1, 2013 at 6:14 PM, Gao Yongwei <itxx00@gmail.com> wrote: [...]
We can get "Boot VMs from sheepdog volumes in Libvirt" way from https://github.com/collie/sheepdog/wiki/Libvirt like following.
a, prepare a file containing an XML domain description
$ cat > sheepdog.xml <domain type='qemu'> <name>testvm</name> <memory>1048576</memory> <os> <type arch='x86_64'>hvm</type> </os> <devices> <disk type='network'> <source protocol="sheepdog" name="testvdi"/> <target dev='hda' bus='ide'/> </disk> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain>
b, boot from testvdi with virsh
$ virsh create sheepdog.xml
c, connect to a VNC console of the running VM
$ vncviewer localhost
I have some following questions about up three steps.
1, Before a or b(up boot step) step, should we have to install our OS into 'testvdi'?
As I know, you should install an OS in the disk,or cannot boot from a 'NULL' disk.you know what i mean.
You just said with a common sense, which has no *real* help for me. *Please* see the step a then explain how to install os into testvdi. I think boot from VMs from Sheepdog volumes, which has to install OS into Sheepdog volumes. How should we install OS into Sheepdog volumes?
That is to say, we have to install OS from os.iso file into 'testvdi', which should use 'qemu-system-x86_64' command to install OS, right?
To install an OS, you could use 'virt-install' ,or use the virt-manager GUI tool.
Are you sure about your words? I think Step a boots VM from testvdi, which is a Sheepdog volume. You could use 'virt-install' to install a OS into Sheepdog volumes, like testvdi? BTW: Does 'virt-install' belong to Libvirt library source code? After i compile libvirt source code, i cannot find 'virt-install'.
3, This is the storage online management in Libvirt, right?
later version of libvirt support managing sheepdog storage,use may have a search at libvirt.org.
Have you ever booted a VM from Sheepdog volume? What steps did you do to finish this job?
4, This test just test the codes Morita take a patch named "add network disk support" for Libvirt, which is located here:
http://libvirt.org/git/?p=libvirt.git;a=commit;h=036ad5052b43fe9f0d197e89fd1... and also test Sheepdog driver for QEMU, right?
I think just test libvirt environment..
You may not understand my question.
5, If i installed a 32bits OS to testvdi, should i modify <os> <type arch='x86_64'>hvm</type> </os> to be <os> <type arch='x86'>hvm</type> </os> , right?
If arch='x86_64', then this configuration support both x86 and x64.
What is *x64*? I am not clear about your words.
6, The step c (up boot step), which is $ vncviewer localhost Actually, i am not clear about this 'localhost'. Why should we link localhost but other ip addresses?
As localhost allways singed to 127.0.0.1 ,or you can use 127.0.0.1 instead of a name like 'locallhost'.
I just ask why we should link localhost. *NOT* what is localhost. You may not understand my question. Thanks for your suggestions. -- Thanks Harry Wei

2013/2/1 harryxiyou <harryxiyou@gmail.com>
On Fri, Feb 1, 2013 at 6:14 PM, Gao Yongwei <itxx00@gmail.com> wrote: [...]
We can get "Boot VMs from sheepdog volumes in Libvirt" way from https://github.com/collie/sheepdog/wiki/Libvirt like following.
a, prepare a file containing an XML domain description
$ cat > sheepdog.xml <domain type='qemu'> <name>testvm</name> <memory>1048576</memory> <os> <type arch='x86_64'>hvm</type> </os> <devices> <disk type='network'> <source protocol="sheepdog" name="testvdi"/> <target dev='hda' bus='ide'/> </disk> <graphics type='vnc' port='-1' autoport='yes'/> </devices> </domain>
b, boot from testvdi with virsh
$ virsh create sheepdog.xml
c, connect to a VNC console of the running VM
$ vncviewer localhost
I have some following questions about up three steps.
1, Before a or b(up boot step) step, should we have to install our OS into 'testvdi'?
As I know, you should install an OS in the disk,or cannot boot from a 'NULL' disk.you know what i mean.
You just said with a common sense, which has no *real* help for me. *Please* see the step a then explain how to install os into testvdi. I think boot from VMs from Sheepdog volumes, which has to install OS into Sheepdog volumes. How should we install OS into Sheepdog volumes?
soga,you may not understand my english,^^,if you can speak Chinese I think I can help you more comfortable. I will try my best to share my experience. to get a bootable disk with os installed, you could try this command: wget http://wiki.qemu.org/download/linux-0.2.img.bz2 bunzip2 linux-0.2.img.bz2 kvm-img convert -t directsync linux-0.2.img sheepdog:test
That is to say, we have to install OS from os.iso file into 'testvdi', which should use 'qemu-system-x86_64' command to install OS, right?
To install an OS, you could use 'virt-install' ,or use the virt-manager GUI tool.
Are you sure about your words? I think Step a boots VM from testvdi, which is a Sheepdog volume. You could use 'virt-install' to install a OS into Sheepdog volumes, like testvdi?
BTW: Does 'virt-install' belong to Libvirt library source code? After i compile libvirt source code, i cannot find 'virt-install'.
virt-install does not belong to libvirt,but if you use RHEL or CentOS you could install this tool from yum: yum provides */virt-install or you can get the source from virt-manager.org
3, This is the storage online management in Libvirt, right?
later version of libvirt support managing sheepdog storage,use may have a search at libvirt.org.
Have you ever booted a VM from Sheepdog volume? What steps did you do to finish this job?
to boot a vm from sheep vol you can use command like: kvm -hda sheepdog:test -hdb sheepdog:data
4, This test just test the codes Morita take a patch named "add network disk support" for Libvirt, which is located here:
http://libvirt.org/git/?p=libvirt.git;a=commit;h=036ad5052b43fe9f0d197e89fd1...
and also test Sheepdog driver for QEMU, right?
I think just test libvirt environment..
You may not understand my question.
5, If i installed a 32bits OS to testvdi, should i modify <os> <type arch='x86_64'>hvm</type> </os> to be <os> <type arch='x86'>hvm</type> </os> , right?
If arch='x86_64', then this configuration support both x86 and x64.
What is *x64*? I am not clear about your words.
6, The step c (up boot step), which is $ vncviewer localhost Actually, i am not clear about this 'localhost'. Why should we link localhost but other ip addresses?
As localhost allways singed to 127.0.0.1 ,or you can use 127.0.0.1 instead of a name like 'locallhost'.
I just ask why we should link localhost. *NOT* what is localhost. You may not understand my question.
Thanks for your suggestions.
because VM's default vnc configuration in libvirt xml just binding the vnc port to 127.0.0.1,you can change the default ip address of vnc using virsh: virsh edit testvm
-- Thanks Harry Wei

On Sat, Feb 2, 2013 at 1:33 AM, Gao Yongwei <itxx00@gmail.com> wrote: [...]
soga,you may not understand my english,^^,if you can speak Chinese I think I can help you more comfortable. I will try my best to share my experience. to get a bootable disk with os installed, you could try this command: wget http://wiki.qemu.org/download/linux-0.2.img.bz2 bunzip2 linux-0.2.img.bz2 kvm-img convert -t directsync linux-0.2.img sheepdog:test
This helps me a lot, especially for your recommended linux-0.2.img, which need not install os. Thanks very much ;-) [...]
virt-install does not belong to libvirt,but if you use RHEL or CentOS you could install this tool from yum: yum provides */virt-install or you can get the source from virt-manager.org
Yup, these tools are convenient. We will test our HLFS drivers by these tools. [...]
to boot a vm from sheep vol you can use command like: kvm -hda sheepdog:test -hdb sheepdog:data
We use qemu but kvm to boot a vm. [...]
because VM's default vnc configuration in libvirt xml just binding the vnc port to 127.0.0.1,you can change the default ip address of vnc using virsh: virsh edit testvm
Yup, vnc ip addr is localhost and vnc port is 5900 ;-) Thanks for your help. -- Thanks Harry Wei
participants (2)
-
Gao Yongwei
-
harryxiyou