FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 08-06-2008, 05:17 PM
Cole Robinson
 
Default virtinst: interface for building libvirt storage xml

The attached patch adds an API to virtinst for building
libvirt storage pool and storage volume xml. This largely
works as it did in my previous posting, but it has had
more thorough testing. There is also some documentation
in the code that should make the design a bit more clear.

The general workflow is as follows:

=========================================
import virtinst.Storage.StoragePool as sp

# This gives the appropriate class for the specified pool type
pool_class = sp.get_pool_class(sp.TYPE_FOO)

# Only required params are a conn/uri and name. Default formats
# and target paths have default values, but source paths/
# devices and hostnames obviously have no sensible default, but
# they still aren't required for object instantiation
pool = pool_class(name="foo", conn=someVirConnectInstance)

pool.source_path = "/dev/foo"
etc.

# Prints xml config: will error if all required members aren't
# specified
pool.get_xml_config()

# Attempts to install and build pool on the passed connection
poolobj = pool.install()

# Will return appropriate volume class for this pool type
vol_class = pool.get_volume_class()

# For volumes, we require a pool instead of conn/uri, as well
# as name and capacity
vol = vol_class(name="volfoo", pool=poolobj, capacity=1234)

volobj = vol.install()

=====================================

This doesn't include iscsi, disk, or logical pools or block
device volumes, but those should mostly be a cut and paste
job and I haven't found the time to test them out yet. There
is no harm in them coming later though.

Any comments appreciated.

Thanks,
Cole
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 08-07-2008, 10:56 AM
"Daniel P. Berrange"
 
Default virtinst: interface for building libvirt storage xml

On Wed, Aug 06, 2008 at 12:17:03PM -0400, Cole Robinson wrote:
> The attached patch adds an API to virtinst for building
> libvirt storage pool and storage volume xml. This largely
> works as it did in my previous posting, but it has had
> more thorough testing. There is also some documentation
> in the code that should make the design a bit more clear.
>
> The general workflow is as follows:

ACK, gets my vote - I say commit it - we need to start using it
to get some real world testing of it now as there's only so much
repeated code reviews can do.

Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 08-07-2008, 10:12 PM
Cole Robinson
 
Default virtinst: interface for building libvirt storage xml

Daniel P. Berrange wrote:
> On Wed, Aug 06, 2008 at 12:17:03PM -0400, Cole Robinson wrote:
>> The attached patch adds an API to virtinst for building
>> libvirt storage pool and storage volume xml. This largely
>> works as it did in my previous posting, but it has had
>> more thorough testing. There is also some documentation
>> in the code that should make the design a bit more clear.
>>
>> The general workflow is as follows:
>
> ACK, gets my vote - I say commit it - we need to start using it
> to get some real world testing of it now as there's only so much
> repeated code reviews can do.
>
> Daniel

Committed:

http://hg.et.redhat.com/virt/applications/virtinst--devel?cs=bd1d0b87d5b6

Thanks,
Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 10:20 AM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org