Package org.libvirt
Class StoragePool
java.lang.Object
org.libvirt.StoragePool
A collection of storage
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Connect
The VirConnect Object that represents the Hypervisor of this Domainprotected StoragePoolPointer
the native virStoragePoolPtr. -
Method Summary
Modifier and TypeMethodDescriptionvoid
build
(int flags) Build the underlying storage poolvoid
create
(int flags) Starts this inactive storage poolvoid
delete
(int flags) Delete the underlying pool resources.void
destroy()
Destroy an active storage pool.protected void
finalize()
int
free()
Free a storage pool object, releasing all memory associated with it.boolean
Fetches the value of the autostart flag, which determines whether the pool is automatically started at boot timeProvides the connection pointer associated with a storage pool.getInfo()
Get volatile information about the storage pool such as free space / usage summarygetName()
Fetch the locally unique name of the storage poolint[]
getUUID()
Fetch the globally unique ID of this storage poolFetch the globally unique ID of the storage pool as a stringgetXMLDesc
(int flags) Fetch an XML document describing all aspects of the storage pool.int
isActive()
Determine if the storage pool is currently runningint
Determine if the storage pool has a persistent configuration which means it will still exist after shutting downString[]
Fetch list of storage volume namesint
Fetch the number of storage volumes within a poolvoid
refresh
(int flags) Request that the pool refresh its list of volumes.void
setAutostart
(int autostart) Sets the autostart flagstorageVolCreateXML
(String xmlDesc, int flags) Create a storage volume within a pool based on an XML description.storageVolCreateXMLFrom
(String xmlDesc, StorageVol cloneVolume, int flags) Create a storage volume in the parent pool, using the 'clonevol' volume as input.storageVolLookupByName
(String name) Fetch an object representing to a storage volume based on its name within a poolvoid
undefine()
Undefine an inactive storage pool
-
Field Details
-
vspp
the native virStoragePoolPtr. -
virConnect
The VirConnect Object that represents the Hypervisor of this Domain
-
-
Method Details
-
build
Build the underlying storage pool- Parameters:
flags
- future flags, use 0 for now- Throws:
LibvirtException
-
create
Starts this inactive storage pool- Parameters:
flags
- future flags, use 0 for now- Throws:
LibvirtException
-
delete
Delete the underlying pool resources. This is a non-recoverable operation. The virStoragePool object itself is not free'd.- Parameters:
flags
- flags for obliteration process- Throws:
LibvirtException
-
destroy
Destroy an active storage pool. This will deactivate the pool on the host, but keep any persistent config associated with it. If it has a persistent config it can later be restarted with virStoragePoolCreate(). This does not free the associated virStoragePoolPtr object.- Throws:
LibvirtException
-
finalize
- Overrides:
finalize
in classObject
- Throws:
LibvirtException
-
free
Free a storage pool object, releasing all memory associated with it. Does not change the state of the pool on the host.- Returns:
- number of references left (>= 0)
- Throws:
LibvirtException
-
getAutostart
Fetches the value of the autostart flag, which determines whether the pool is automatically started at boot time- Returns:
- the result
- Throws:
LibvirtException
-
getConnect
Provides the connection pointer associated with a storage pool.- Returns:
- the Connect object
-
getInfo
Get volatile information about the storage pool such as free space / usage summary- Returns:
- a StoragePoolInfo object describing this storage pool
- Throws:
LibvirtException
-
getName
Fetch the locally unique name of the storage pool- Returns:
- the name
- Throws:
LibvirtException
-
getUUID
Fetch the globally unique ID of this storage pool- Returns:
- the UUID as an unpacked int array
- Throws:
LibvirtException
-
getUUIDString
Fetch the globally unique ID of the storage pool as a string- Returns:
- the UUID in canonical String format
- Throws:
LibvirtException
-
getXMLDesc
Fetch an XML document describing all aspects of the storage pool. This is suitable for later feeding back into the virStoragePoolCreateXML method.- Parameters:
flags
- flags for XML format options (set of virDomainXMLFlags)- Returns:
- a XML document -java @throws LibvirtException
- Throws:
LibvirtException
-
isActive
Determine if the storage pool is currently running- Returns:
- 1 if running, 0 if inactive
- Throws:
LibvirtException
- See Also:
-
isPersistent
Determine if the storage pool has a persistent configuration which means it will still exist after shutting down- Returns:
- 1 if persistent, 0 if transient
- Throws:
LibvirtException
- See Also:
-
listVolumes
Fetch list of storage volume names- Returns:
- an Array of Strings that contains the names of the storage volumes
- Throws:
LibvirtException
-
numOfVolumes
Fetch the number of storage volumes within a pool- Returns:
- the number of storage pools
- Throws:
LibvirtException
-
refresh
Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer- Parameters:
flags
- flags to control refresh behaviour (currently unused, use 0)- Throws:
LibvirtException
-
setAutostart
Sets the autostart flag- Parameters:
autostart
- new flag setting- Throws:
LibvirtException
-
storageVolCreateXML
Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes- Parameters:
xmlDesc
- description of volume to createflags
- flags for creation, seeStoragePool.VolumeCreateFlags
- Returns:
- the storage volume
- Throws:
LibvirtException
-
storageVolCreateXMLFrom
public StorageVol storageVolCreateXMLFrom(String xmlDesc, StorageVol cloneVolume, int flags) throws LibvirtException Create a storage volume in the parent pool, using the 'clonevol' volume as input. Information for the new volume (name, perms) are passed via a typical volume XML description.- Parameters:
xmlDesc
- description of volume to createcloneVolume
- storage volume to use as inputflags
- flags for creation, seeStoragePool.VolumeCreateFlags
- Returns:
- The storage volume
- Throws:
LibvirtException
-
storageVolLookupByName
Fetch an object representing to a storage volume based on its name within a pool- Parameters:
name
- name of storage volume- Returns:
- a StorageVol object, or
null
if not found. - Throws:
LibvirtException
-
undefine
Undefine an inactive storage pool- Throws:
LibvirtException
-