Monday, April 30, 2018

Modify Linux virtual Network for KVM Networking



I have created host-only network for VM internal networking such as host-only and now need to modify the IP address for the virtual interface, notice that the edit function is not available using virt-manager.

Given below I want to edit net1 interface IP address from 172.16.0.1 to 172.16.0.254.

1) Get network listing

[root@virtm ~]# virsh net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 net0                 active     yes           yes
 net1                 active     yes           yes
 net2                 active     yes           yes

2) edit the interface

[root@virtm ~]# virsh net-edit net1

<network>
  <name>net1</name>
  <uuid>e0952f30-c192-46ef-8898-bc8904a5dcb7</uuid>
  <bridge name='virbr1' stp='on' delay='0'/>
  <mac address='52:54:00:d4:44:d8'/>
  <domain name='net1'/>
  <ip address='172.16.0.1' netmask='255.255.255.0'>
  </ip>
</network>

Save and Quit

3) Restart the interface

[root@virtm ~]# virsh net-destroy net1
Network net1 destroyed

[root@virtm ~]# virsh net-start net1
Network net1 started

4) Verify the output using Linux ip command

[root@virtm ~]# ip a |grep vir

13: virbr1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000

    inet 172.16.0.254/24 brd 172.16.0.255 scope global virbr1


Monday, January 9, 2017

Steps to convert RHEV/Ovirt VM in export domain to qcow2 format


full path for below steps 
/home/exports_domain/fd251a1b-9665-4d3a-b307-66688ae7dab2/images/7a64ffa1-e759-4a62-aac8-bf01a78f1b7c

 
1) configure export domain (example using nfs) and export the VM into it
 
2) on the linux host which have access to the nfs export domain in this example a vm exported to /home/exports_domain
 
3) cd into the fd251a1b-9665-4d3a-b307-66688ae7dab2, you will see a folder called 'images'
 
4) cd into the 'images' folder'
 
5) cd into the folder, in this example 7a64ffa1-e759-4a62-aac8-bf01a78f1b7c
 
6) check the content of the folder, you will see a file bb2794b7-3578-4eee-9d60-79853a689c4d in this case 50GB, the other one is the meta file.
 
7) run this command for conversion to qcow2 format
 
qemu-img convert -O qcow2 bb2794b7-3578-4eee-9d60-79853a689c4d jbossfile.qcow2

8) run the qcow2 on linux kvm,virtual box etc.