Differences between revisions 5 and 25 (spanning 20 versions)
Revision 5 as of 2017-11-11 22:41:12
Size: 832
Editor: shran
Comment:
Revision 25 as of 2021-02-19 19:14:12
Size: 1717
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Your domain is virtual hardware. This hardware is described in an XML file. The XML files are stored in `/etc/libvirt/qemu/`.There is one file for each domain. In a physical computer it is not a good idea to replace hardware while the computer is running. The same can be said for the virtual domain. Start by shutting down the guest, then edit the domain. Your domain is virtual hardware. This hardware is described in an XML file. The XML file is stored in `/etc/libvirt/qemu/`. There is one file for each domain. It is possible to use virsh to dump the XML.

{{{
virsh dumpxml clone
}}}
I
n a physical computer it is not a good idea to replace hardware while the computer is running. The same can be said for the virtual domain. Start by shutting down the guest, then edit the domain. That being said there are many pieces of virtual hardware that can be added while the guest is running.
Line 11: Line 16:
During installation it is usefull to have access to the console of the domain. Once installed this is no longer needed. The following section can be removed from the configuration to disable access to the domain console. During installation it is usefull to have access to the console of the domain. After the installation this is no longer needed. The following section can be removed from the configuration to disable access to the domain console.
Line 19: Line 24:

== CPU ==
Change the number of CPUs in the domain.
{{{
<vcpu placement='static'>8</vcpu>
}}}
== Memory ==

Increase or decrease the memory by editing this line.

{{{
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
}}}

== Disk ==

This is how we add an additional 16G harddisk to a domain, while the domain is running.

Create the new volume.
{{{
lvcreate --size 16G --name kvm_clone_vdb vg_storage
}}}

Add the disk to the domain.
{{{
virsh attach-disk clone --source /dev/vg_storage/kvm_clone_vdb --target vdb --persistent
}}}

== Network Interface ==

Check your MAC address
{{{
<mac address='52:54:00:9e:33:2f'/>
}}}

Domain Editing

Your domain is virtual hardware. This hardware is described in an XML file. The XML file is stored in /etc/libvirt/qemu/. There is one file for each domain. It is possible to use virsh to dump the XML.

virsh dumpxml clone

In a physical computer it is not a good idea to replace hardware while the computer is running. The same can be said for the virtual domain. Start by shutting down the guest, then edit the domain. That being said there are many pieces of virtual hardware that can be added while the guest is running.

virsh edit clone

Console

During installation it is usefull to have access to the console of the domain. After the installation this is no longer needed. The following section can be removed from the configuration to disable access to the domain console.

<graphics type='spice' autoport='yes' listen='192.168.1.33'>
  <listen type='address' address='192.168.1.33'/>
  <image compression='off'/>
</graphics>

CPU

Change the number of CPUs in the domain.

<vcpu placement='static'>8</vcpu>

Memory

Increase or decrease the memory by editing this line.

<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>

Disk

This is how we add an additional 16G harddisk to a domain, while the domain is running.

Create the new volume.

lvcreate --size 16G --name kvm_clone_vdb vg_storage

Add the disk to the domain.

virsh attach-disk clone --source /dev/vg_storage/kvm_clone_vdb --target vdb --persistent

Network Interface

Check your MAC address

<mac address='52:54:00:9e:33:2f'/>

None: Domain Editing (last edited 2021-02-19 19:14:12 by Kristian Kallenberg)