[libvirt-users] How to start a storage pool using libvirt?

Hi what is the libvirt API call to start an inactive storage pool created using the python binding storagePoolDefineXML() ? There seems to be a virsh command which is pool-start <pool-name>, but I am not sure what would be the call to start it. Or is there a way to start the pool while it is being defined itself? The autostart will be effective only when libvirtd service is restarted? Thank you -- Regards Ananth

I figured out that poolObject.create(0) can start the storage pool. Is there a way to automatically create the folder, if the folder does not exist while defining a pool? for example, if i do pool-define myPool.xml, how can I make it create the folder if the target path does not exist? Is it necessary that the path specified in the xml should exist already? Regards Ananth On Thu, Jun 28, 2012 at 7:32 PM, Ananth <cbananth@gmail.com> wrote:
Hi what is the libvirt API call to start an inactive storage pool created using the python binding storagePoolDefineXML() ? There seems to be a virsh command which is pool-start <pool-name>, but I am not sure what would be the call to start it. Or is there a way to start the pool while it is being defined itself? The autostart will be effective only when libvirtd service is restarted?
Thank you
-- Regards Ananth
-- Regards Ananth

On 2012年06月28日 22:20, Ananth wrote:
I figured out that poolObject.create(0) can start the storage pool. Is there a way to automatically create the folder, if the folder does not exist while defining a pool? for example, if i do pool-define myPool.xml, how can I make it create the folder if the target path does not exist? Is it necessary that the path specified in the xml should exist already?
There is API for build the pool. The C level API is virStoragePoolBuild. I.e. For a persistent pool, there are generally 3 steps to get a new pool started. 1) define 2) build 3) start The Python API: virStoragePool.build For a non-persistent pool, you might want to use virStoragePoolCreateXML, which will create the pool as trasicient, and start it. Yeah, no build process. I'm thinking it's desired to introduce a flag for virStoragePoolCreate and virStoragePoolCreateXML, to allow to build the pool meanwhile. e.g. "--build" for command "virsh pool-start". Regards, Osier Regards, Osier
participants (2)
-
Ananth
-
Osier Yang