User Tools

Site Tools


public:techstuff:libvirt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:techstuff:libvirt [2012/09/22 12:49] nathanpublic:techstuff:libvirt [2020/04/25 13:05] (current) – external edit 127.0.0.1
Line 3: Line 3:
 ===== Creating a VM ===== ===== Creating a VM =====
  
-==== Basic install ====+==== Creating an KVM VM ====
  
   virt-install   virt-install
Line 13: Line 13:
   --disk=/img/<vm name>.img,device=disk,bus=virtio,size=<disk size GB>,sparse=true,format=raw   --disk=/img/<vm name>.img,device=disk,bus=virtio,size=<disk size GB>,sparse=true,format=raw
  
-==== Existing image ====+==== Creating an LXC VM ==== 
 + 
 +  * Capped resources at 512mb of ram and 2 cpus 
 + 
 +  cd /img 
 +  mkdir <vmname> 
 +  sudo debootstrap wheezy <vmname> http://mirror.byte.net.nz/debian/ 
 +  sudo virt-install --connect lxc:/// --name cubert --ram 512 --vcpu 2 --filesystem /img/cubert/,/ --noautoconsole -w network=vm 
 + 
 +  virt-install \ 
 +  --connect lxc:/// 
 +  --name httpd_guest 
 +  --ram 512 
 +  --vcpus 2 
 +==== Existing KVM image ====
  
   virt-install   virt-install
Line 34: Line 48:
 <code>--disk pool=<pool name>,size=<size in GB>,bus=virtio,cache=none</code> <code>--disk pool=<pool name>,size=<size in GB>,bus=virtio,cache=none</code>
  
-  * If you want a specific name you'll need to create the LV manually first.+  * If you want a specific name you'll need to create the volume manually first.
  
-<code>virsh vol-create-as <pool name> <LV Name> <size></code>+<code>virsh vol-create-as <pool name> <volume name> <size></code>
  
-  * And then use this line to specify it.+And then use this line to specify it.
  
-<code>--disk vol=<poolname>/<LVname>,bus=virtio,cache=none</code>+<code>--disk vol=<poolname>/<volume name>,bus=virtio,cache=none</code>
  
 ===== Open Serial Console to VM ===== ===== Open Serial Console to VM =====
public/techstuff/libvirt.1348318196.txt.gz · Last modified: 2020/04/25 13:05 (external edit)