KVM virtual machine system configuration files

First, the virtual machine configuration file

      Each KVM virtual host has its own configuration files are named virtual host name; KVM virtual machine's configuration file in / etc / libvirt / qemu /, there is an xml file;
[root@localhost ~]# cd /etc/libvirt/qemu/

Displays the virtual host list

[root@localhost qemu]# virsh list --all
 Id 名称 状态
----------------------------------------------------
 3 ehs-vm-01 running
 4 ehs-oracle-01 running

View KVM virtual machine configuration file information

[root@localhost qemu]# ls
ehs-oracle-01.xml ehs-vm-01.xml networks

View  ehs-vm-01 information

[QEMU the root @ localhost] # virsh dominfo EHS-vm- 01  
Id: . 3 
Name: EHS -vm- 01 
the UUID: b2a48a5b -999b-494e-93d0- b2deddd1013c 
the OS Type: HVM 
Status: running 
the CPU: 2 
the CPU time: 157 . 9s 
maximum memory: 4194304 KiB 
memory usage: 4194304 KiB 
lasting: is 
automatically activated: disable 
save Administration: No 
security mode: none 
security DOI: 0

Set ehs-vm-01 boot from Kai

[QEMU the root @ localhost] # virsh autostart EHS-vm- 01  
domain EHS -vm automatic start-labeled 01

autostart to boot from Kai directory

[root@localhost qemu]# ls
autostart ehs-oracle-01.xml ehs-vm-01.xml networks

Centos7.0 edit the virtual machine configuration file, call vi

[root@localhost qemu]# virsh edit ehs-vm-01

Set virsh edit Highlight

[root@localhost qemu]# export EDITOR=vim

Backup centos7.0 virtual host configuration file

[root@localhost qemu]# virsh dumpxml ehs-vm-01 > ehs-vm-01.bak 

Second, the virtual machine network configuration files

[root@localhost qemu]# cd /etc/libvirt/qemu/networks

View network information

[root @ localhost Networks] # virsh NET-List - All 
 names state begins automatically lasting
 ------------------------------- --------------------------- 
 default inactive Yes

A list of the relevant list

[the root @ localhost Networks] # virsh --help | grep list 
    domblklist lists all domain blocks 
    domiflist virtual interface lists all the domains 
    list List field 
    iface - list the physical host interface listing 
    nwfilter - list list Network filters 
    nwfilter -binding- network Bindings list filter list 
    nET - list lists the network 
    nodedev - enumerate the device list in this host of 
    Secret - list list the Secret 
    snapshot - list for the domain list snapshots
    the pool -list lists the pool 
    Vol -list to list the volumes

Editing Network File

[root@localhost networks]# virsh net-edit default
<network>
  <name>default</name>
  <uuid>d0efc2ef-1ed1-4b82-9fd8-0043a0accd05</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0'/>
  <mac address='52:54:00:e0:25:f5'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254'/>
    </dhcp>
  </ip>
</network>

Third, the virtual machine storage profile

[root@localhost networks]# cd /etc/libvirt/storage/
[root@localhost storage]# ll
总用量 8
drwxr-xr-x. 2 root root 40 9月 4 10:44 autostart
-rw-------. 1 root root 538 9月 4 10:40 default.xml
-rw-------. 1 root root 515 9月 4 10:44 iso.xml

Display a list of storage

[root @ localhost Storage] # virsh the pool-List - All 
 names status automatically start
 -------------------------------- ----------- 
 default activity is        
 iso activities       

Edit the store configuration file

[root@localhost storage]# virsh pool-edit default

Fourth, the image file [disk file]

[root@localhost storage]# cd /var/lib/libvirt/images/
[root@localhost images]# ll
总用量 83899404
-rw------- 1 qemu qemu 53695545344 9月   4 17:28 ehs-oracle-01.qcow2
-rw------- 1 qemu qemu 32217432064 9月   4 17:27 ehs-vm-01.qcow2

 

Guess you like

Origin www.cnblogs.com/opma/p/11607029.html
Recommended