LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 10-02-2014, 09:38 AM   #1
donghyun Kim
LQ Newbie
 
Registered: Oct 2014
Posts: 4

Rep: Reputation: Disabled
[URGENT] Is 'virt-install' cannot generate isolated VMs using same existing qcow2 ?


Hello,

I have a big trouble on using kvm-libvirt.

I have a customized qcow2 image (I extracted it using virtualbox-NAT network)

and generated 3 VMs.

Each customized VM download network interface file from remote server in booting process onto its mac address and automatically change its /etc/network/interfaces.

when I generate 1 VM, it works well, but 3 VMs work wrong. I think that multiple VMs share each resource and network configuration process goes wrong. When I install new VM machine using same qcow2, after that the network setting is not same with default qcow2 network setting (I think that My networking change process is reflected on it)

My VM installation ex command is as below (VMs: test1,test2,test3)

virt-insatll --name test2 --ram 512 --vcpus 1 --disk path=/home/dhkim/image/1002_ver6.qcow2,format=qcow2,sparse=true --noautoconsole --import --force --mac 08:00:27:re:5d:12

How can I generate multiple isolated VMs without changing original qcow2 image in command?
(I want to get same result - for example virtualbox, <new> VM, not import, and bring *.vmdk existing image and start, repeat 3 times , and then generate 3 isolated VMs)

please reply me,

Thank you

Last edited by donghyun Kim; 10-02-2014 at 09:40 AM.
 
Old 10-02-2014, 09:51 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
Subject:

Bad: "Help Me!!" or "URGENT"
Good: "Why is my mouse pointer wrong?"
Best: "Mouse pointer distorted on XFree86 4.3 with Geforce FX 5200"
you using the same mac address for all 3?
 
Old 10-02-2014, 12:23 PM   #3
donghyun Kim
LQ Newbie
 
Registered: Oct 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
of course not I used diffrent mac address
 
Old 10-03-2014, 08:38 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
did you use the same qcow2 file for all three VMs, or did you clone the file/take three different snapshot of the original template?

did you wipe /etc/udev/rules.d/70-persistent-net.rules before cloning the VM image?
 
Old 10-03-2014, 11:28 PM   #5
donghyun Kim
LQ Newbie
 
Registered: Oct 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dyasny View Post
did you use the same qcow2 file for all three VMs, or did you clone the file/take three different snapshot of the original template?

did you wipe /etc/udev/rules.d/70-persistent-net.rules before cloning the VM image?
--> Oh I used same qcow2 image and import it all 3 VMs, How can I clone snapshot qcow2? and Do I have to wipe 70-persistent-net.rules in host? guest? and could you please explain why?

Last edited by donghyun Kim; 10-03-2014 at 11:40 PM.
 
Old 10-04-2014, 09:25 AM   #6
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
First, wipe 70-persistent-net.rules on the qcow2 image.
Second, create snapshots for each VM.

You are trying to use the same qcow2 image for 3 different VMs, and that is the equivalent to using 3 computers with the same hard drive... it simply can not be done.

Using a snapshot, however, you can use your original qcow2 image as a read-only gold image and the snapshot is where files are written.

See documentation: http://wiki.qemu.org/Documentation/CreateSnapshot
 
Old 10-04-2014, 07:30 PM   #7
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
you cannot attach 3 VMs to the same disk image. Imagine connecting one hard drive to three separate computers as the main and only drive. You need to either make 3 copies of the original qcow2 or use qemu-img to create three snapshots and base your VMs on those. The latter option will save you some space (though it might end up being more space wasted in the long run) but it will cost you some disk access speed.

the persistent-net.rules file should be wiped in the guests. Don't know about Ubuntu, but in RHEL there's a "sys-unconfig" utility which will prepare the system to be redeployed, essentially removing ssh keys, mac address references and other individual host settings, so the image can be easily cloned.
 
Old 10-05-2014, 12:58 AM   #8
donghyun Kim
LQ Newbie
 
Registered: Oct 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dyasny View Post
you cannot attach 3 VMs to the same disk image. Imagine connecting one hard drive to three separate computers as the main and only drive. You need to either make 3 copies of the original qcow2 or use qemu-img to create three snapshots and base your VMs on those. The latter option will save you some space (though it might end up being more space wasted in the long run) but it will cost you some disk access speed.

the persistent-net.rules file should be wiped in the guests. Don't know about Ubuntu, but in RHEL there's a "sys-unconfig" utility which will prepare the system to be redeployed, essentially removing ssh keys, mac address references and other individual host settings, so the image can be easily cloned.

In Openstack, I can generate multiple VMs using single qcow2 image easily without copying the image. I don't know exactly how it is going on, Is there any option to generate multiple VMs using libvirt like openstack?
 
Old 10-05-2014, 12:51 PM   #9
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by donghyun Kim View Post
In Openstack, I can generate multiple VMs using single qcow2 image easily without copying the image. I don't know exactly how it is going on, Is there any option to generate multiple VMs using libvirt like openstack?
openstack (well, nova actually) will copy a disk copy for every instance from the glance image repository. So on the host that runs the VMs, you get three disk image copies.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virt manager won't start my VMs kkroopani Linux - Virtualization and Cloud 1 10-21-2012 12:53 AM
[SOLVED] virt-install: permission denied accessing qcow2 formatted volume ordinary Linux - Virtualization and Cloud 1 10-02-2012 04:43 PM
[Tcptraceroute/Traceroute/Ping] Windows VMs & Linux VMs BiFo Linux - Networking 0 08-24-2010 02:07 PM
LXer: Hacking libvirt/virsh/virt-manager/virt-install at Xen 4.0 Dom0 on top of Ubunt LXer Syndicated Linux News 0 05-06-2010 02:50 PM
LXer: Virt-install&Virt-manager at Xen 4.0-rc8 (2.6.32.10 pvops) Dom0 on top Ubuntu K LXer Syndicated Linux News 0 03-26-2010 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration