[libvirt] storage: pool definition discarded by pool-create failure

2011-11-21 Thread lvroyce

1.how to reproduce:
(1)just use LVM disk,leave libvirt create vg
(2)xml:
pool type='logical'
namepic_pool2/name
source
device path='/dev/sdb1'/
device path='/dev/sdb2'/
/source
target
path/dev/pic_pool2/path
/target
/pool

(3)steps:
a.start libvirtd,copy xml
b.virsh pool-define lvm_pool.xml
c.virsh pool-list --all
lvm_pool exsists
c.virsh pool-create lvm_pool.xml
lvm_pool disappears

2.analyze:
here pool-create fails because of vg has not been built before 
vgchange,and pool-create will delete pool-def after failure.
pool-create can fail because a lot of reasons, but it doesn't mean 
previous pool definition should be obselete,previous definition should 
remain unchanged if following pool management fails.


3.fix:
shall we make backend-startPool gurantee pool unchanged in condition of 
start fails or offer an undo function after failure?


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] storage: pool definition discarded by pool-create failure

2011-11-21 Thread Osier Yang

On 2011年11月22日 10:38, lvroyce wrote:

1.how to reproduce:
(1)just use LVM disk,leave libvirt create vg
(2)xml:
pool type='logical'
namepic_pool2/name
source
device path='/dev/sdb1'/
device path='/dev/sdb2'/
/source
target
path/dev/pic_pool2/path
/target
/pool

(3)steps:
a.start libvirtd,copy xml
b.virsh pool-define lvm_pool.xml
c.virsh pool-list --all
lvm_pool exsists
c.virsh pool-create lvm_pool.xml
lvm_pool disappears

2.analyze:
here pool-create fails because of vg has not been built before 
vgchange,and pool-create will delete pool-def after failure.
pool-create can fail because a lot of reasons, but it doesn't mean 
previous pool definition should be obselete,previous definition should 
remain unchanged if following pool management fails.


Actually there is similiar problem for domain create too.

# virsh define test.xml
# virsh create test.xml

It's caused domainCreateXML will free the domain config
regardless of if the domain is persistent or not. But the
persistent XML file is not removed, once libvirtd is restarted,
you will see the domain again.

The problem here is it should check if the domain conf
is persistent before free() it, or prohibit creating the domain
if it's already defined. Not sure which way is better, but
considering we allow to re-define a domain config, may
be the first way is right way to go?

Regards,
Osier


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] storage: pool definition discarded by pool-create failure

2011-11-21 Thread Osier Yang

On 2011年11月22日 10:38, lvroyce wrote:

1.how to reproduce:
(1)just use LVM disk,leave libvirt create vg
(2)xml:
pool type='logical'
namepic_pool2/name
source
device path='/dev/sdb1'/
device path='/dev/sdb2'/
/source
target
path/dev/pic_pool2/path
/target
/pool

(3)steps:
a.start libvirtd,copy xml
b.virsh pool-define lvm_pool.xml
c.virsh pool-list --all
lvm_pool exsists
c.virsh pool-create lvm_pool.xml
lvm_pool disappears

2.analyze:
here pool-create fails because of vg has not been built before 
vgchange,and pool-create will delete pool-def after failure.
pool-create can fail because a lot of reasons, but it doesn't mean 
previous pool definition should be obselete,previous definition should 
remain unchanged if following pool management fails.


Actually there is similiar problem for domain create too.

# virsh define test.xml
# virsh create test.xml

It's caused domainCreateXML will free the domain config
regardless of if the domain is persistent or not. But the
persistent XML file is not removed, once libvirtd is restarted,
you will see the domain again.

The problem here is it should check if the domain conf
is persistent before free() it, or prohibit creating the domain
if it's already defined. Not sure which way is better, but
considering we allow to re-define a domain config, may
be the first way is right way to go?

Regards,
Osier


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list