Bug 889480 - net-define network is not persistent
net-define network is not persistent
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-21 05:53 EST by yanbing du
Modified: 2014-06-17 20:43 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-1.0.2-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 08:10:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description yanbing du 2012-12-21 05:53:05 EST
Description of problem:
Use virsh net-define command to define a network, the network is not persistent, after destroy, it will gone.

Version-Release number of selected component (if applicable):
libvirt-1.0.1-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a network xml, which can dump from the default network
# virsh net-dumpxml tt
<network>
  <name>tt</name>
  <uuid>6e9bb2dd-b99d-630f-39d1-b69a806da550</uuid>
  <forward mode='nat'/>
  <bridge name='virbr1' stp='on' delay='0' />
  <mac address='52:54:00:E5:B6:95'/>
  <ip address='192.168.121.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.121.2' end='192.168.121.254' />
    </dhcp>
  </ip>
</network>

2. Define, start and destroy the network
# virsh net-define de.xml 
Network tt defined from de.xml

# virsh net-list --all
Name                 State      Autostart     Persistent
--------------------------------------------------
default              active     yes           yes
tt                   inactive   no            no

# virsh net-start tt
Network tt started

# virsh net-list --all
Name                 State      Autostart     Persistent
--------------------------------------------------
default              active     yes           yes
tt                   active     no            no

# virsh net-destroy tt
Network tt destroyed

# virsh net-list --all
Name                 State      Autostart     Persistent
--------------------------------------------------
default              active     yes           yes
  
Actual results:
The new define network is not persistent.

Expected results:
net-define network should be persistent.

Additional info:
Comment 2 yanbing du 2012-12-24 03:35:33 EST
Hi Laine,

I tested this bug with libvirt-0.9.11.3-1.el7.x86_64
# virsh net-list --all
Name                 State      Autostart
-----------------------------------------
default              active     yes       
net1                 active     no        

There's no 'Persistent' parameter when list networks.

# virsh net-info net1
Name            net1
UUID            de9fb474-0882-b37a-d22a-498a19776d7f
Active:         yes
Persistent:     yes
Autostart:      no
Bridge:         virbr1

The new defined network is persistent.

Do you thinks this's a regression bug?
Comment 3 Osier Yang 2012-12-26 03:53:53 EST
This is regression introduced by commit 0211fd6e04: See,

https://www.redhat.com/archives/libvir-list/2012-December/msg01355.html
Comment 6 Peter Krempa 2013-01-11 08:15:12 EST
Fixed upstream:

commit bb19491cf5e3b78f2d72bbcbcc06e985d29b7f4b
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Fri Jan 11 11:10:34 2013 +0100

    network: bridge: Fix regression when defining persistent networks
    
    Commit 0211fd6e04cdc402da20818df54299c6ded3d3cb introduced regression
    where newly defined networks were not made persistent.
    
    This patch makes the network persistent on each successful definition.

Moving to POST.
Comment 7 hongming 2013-02-05 00:49:15 EST
Verify it as follows. Change its status to VERIFIED.

Versions
libvirt-1.0.2-1.el7.x86_64

#cat network.xml
<network>
  <name>tt</name>
  <uuid>6e9bb2dd-b99d-630f-39d1-b69a806da550</uuid>
  <forward mode='nat'/>
  <bridge name='virbr1' stp='on' delay='0' />
  <mac address='52:54:00:E5:B6:95'/>
  <ip address='192.168.121.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.121.2' end='192.168.121.254' />
    </dhcp>
  </ip>
</network>

# virsh net-define network.xml
Network tt defined from network.xml


# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 tt                   inactive   no            yes

# virsh net-start tt
Network tt started

# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 tt                   active     no            yes


# virsh net-destroy tt
Network tt destroyed

# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 tt                   inactive   no            yes
Comment 8 Ludek Smid 2014-06-13 08:10:11 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.