Sys::V...gePool(3pm)
π NAME π
okay bestie, this is Sys::V...gePool(3pm) β aka the manual page for Sys::Virt::StoragePool β from User Contributed Perl Documentation. It's the module that does Represent & manage a libvirt storage pool. Yes, the ampersand is literally in the original, we're keeping it. π
β¨ DESCRIPTION β¨
The Sys::Virt::StoragePool module represents a storage pool managed by libvirt. There are a variety of storage pool implementations for LVM, Local directories/filesystems, network filesystems, disk partitioning, iSCSI, and SCSI. iconic range, honestly π
π οΈ METHODS π οΈ
my $uuid = $pool->get_uuid()
Returns a 16 byte long string containing the raw globally unique identifier (UUID) for the storage pool. raw UUID energy β¨
my $uuid = $pool->get_uuid_string()
Returns a printable string representation of the raw UUID, in the format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'. pretty UUID, slay π
my $name = $pool->get_name()
Returns a string with a locally unique name of the storage pool. local queen behavior π
$pool->is_active()
Returns a true value if the storage pool is currently running. vibe check: active β
$pool->is_persistent()
Returns a true value if the storage pool has a persistent configuration file defined. persistent, not just a phase π¦
my $xml = $pool->get_xml_description()
Returns an XML document containing a complete description of the storage pool's configuration. the whole XML look, complete π
$pool->create()
Start a storage pool whose configuration was previously defined using the define_storage_pool method in Sys::Virt. wake it up π₯
$pool->undefine()
Remove the configuration associated with a storage pool previously defined with the define_storage pool method in Sys::Virt. If the storage pool is running, you probably want to use the destroy method instead. careful, bestie π
$pool->destroy()
Immediately stop the storage pool. immediately. no soft launch. π
$flag = $pool->get_autostart();
Return a true value if the storage pool is configured to automatically start upon boot. Return false, otherwise. boot-time main character energy β
$pool->set_autostart($flag)
Set the state of the autostart flag, which determines whether the storage pool will automatically start upon boot of the host OS. set the vibe for next boot π
$pool->refresh([$flags]);
Refresh the storage pool state. Typically this will rescan the list of storage volumes. The $flags parameter is currently unused and if omitted defaults to zero. lowkey unused flags, but noted π«Ά
$pool->build([$flags]);
Construct the storage pool if it does not exist. As an example, for a disk based storage pool this would ensure a partition table exists. The $flags parameter allows control over the build operation and if omitted defaults to zero. build it from the ground up π§
$pool->delete([$flags]);
Delete the storage pool. The $flags parameter allows the data to be optionally wiped during delete and if omitted defaults to zero. optional wipe, so read twice π¨
$info = $pool->get_info()
Retrieve information about the current storage pool state. The returned hash reference has the following keys:
stateβ The current status of the storage pool. See constants later. state check πcapacityβ The total logical size of the storage pool. big picture capacity π½allocationβ The current physical allocation of the storage pool. what's actually allocated πavailableβ The available space for creation of new volumes. This may be less than the difference between capacity & allocation if there are sizing / metadata constraints for volumes. math is not always mathing π
my $nnames = $pool->num_of_storage_volumes()
Return the number of running volumes in this storage pool. The value can be used as the maxnames parameter to list_storage_vol_names. count first, list later π¦
my @volNames = $pool->list_storage_vol_names($maxnames)
Return a list of all volume names in this storage pool. The names can be used with the get_volume_by_name method. names, names, names π
my @vols = $pool->list_volumes()
Return a list of all volumes in the storage pool. The elements in the returned list are instances of the Sys::Virt::StorageVol class. This method requires O(n) RPC calls, so the list_all_volumes method is recommended as a more efficient alternative. O(n) RPC calls? not the efficient route, bestie π«Ά
my @volumes = $pool->list_all_volumes($flags)
Return a list of all storage volumes associated with this pool. The elements in the returned list are instances of the Sys::Virt::StorageVol class. The $flags parameter can be used to filter the list of return storage volumes. filtered volume list, we love efficiency β¨
my $vol = $pool->get_volume_by_name($name)
Return the volume with a name of $name. The returned object is an instance of the Sys::Virt::StorageVol class. name match, volume found π―
my $vol = $pool->create_volume($xml)
Create a new volume based on the XML description passed into the $xml parameter. The returned object is an instance of the Sys::Virt::StorageVol class. If the optional clonevol is provided, data will be copied from that source volume. new volume just dropped π₯
my $vol = $pool->clone_volume($xml, $clonevol);
Create a new volume based on the XML description passed into the $xml parameter. The returned object is an instance of the Sys::Virt::StorageVol class. The new volume will be populated with data from the specified clone source volume. clone era π§¬
π CONSTANTS π
The following sets of constants may be useful in dealing with some of the methods in this package. constant stans, this is your moment β
π STORAGE POOL DEFINE π
The following constants can be used to control the behaviour of storage pool define operations.
Sys::Virt::StoragePool::DEFINE_VALIDATEβ Validate the XML document against the XML schema. schema validation, no cap β
π POOL STATES π
The following constants are useful for interpreting the state key value in the hash returned by get_info.
Sys::Virt::StoragePool::STATE_INACTIVEβ The storage pool is not currently active. asleep, not slaying π΄Sys::Virt::StoragePool::STATE_BUILDINGβ The storage pool is still being constructed and is not ready for use yet. cooking, not ready π³Sys::Virt::StoragePool::STATE_RUNNINGβ The storage pool is running and can be queried for volumes. up and serving βSys::Virt::StoragePool::STATE_DEGRADEDβ The storage pool is running, but its operation is degraded due to a failure. running but not okay πSys::Virt::StoragePool::STATE_INACCESSIBLEβ The storage pool is not currently accessible. can't get in πͺ
π¦ DELETION MODES π¦
Sys::Virt::StoragePool::DELETE_NORMALβ Delete the pool without any attempt to scrub data. normal delete, no scrub π§ΉSys::Virt::StoragePool::DELETE_ZEROEDβ Fill the allocated storage with zeros when deleting. zero fill on delete 0οΈβ£
πΈ BUILD MODES πΈ
Sys::Virt::StoragePool::BUILD_NEWβ Construct a new storage pool from constituent bits. new pool from the bits π§±Sys::Virt::StoragePool::BUILD_RESIZEβ Resize an existing built storage pool preserving data where appropriate. resize, preserve the data πSys::Virt::StoragePool::BUILD_REPAIRβ Repair an existing storage pool operating in degraded mode. repair era π οΈSys::Virt::StoragePool::BUILD_NO_OVERWRITEβ Do not overwrite existing storage pool data. do not overwrite, bestie πSys::Virt::StoragePool::BUILD_OVERWRITEβ Overwrite existing storage pool data. overwrite, dramatic π₯
β¨ CREATE MODES β¨
When creating a storage pool it can be built at the same time. The following values are therefore close to their BUILD counterparts.
Sys::Virt::StoragePool::CREATE_NORMALβ Just create the storage pool without building it. create only, no build πSys::Virt::StoragePool::CREATE_WITH_BUILDβ When creating new storage pool also perform pool build without any flags. create plus build π§Sys::Virt::StoragePool::CREATE_WITH_BUILD_OVERWRITEβ Create the pool and perform pool build using theBUILD_OVERWRITEflag. This is mutually exclusive toCREATE_WITH_BUILD_NO_OVERWRITE. mutually exclusive, pick one βοΈSys::Virt::StoragePool::CREATE_WITH_BUILD_NO_OVERWRITEβ Create the pool and perform pool build using theBUILD_NO_OVERWRITEflag. This is mutually exclusive toCREATE_WITH_BUILD_OVERWRITE. also mutually exclusive, don't do both π¨
β XML DOCUMENTS β
The following constants are useful when requesting XML for storage pools.
Sys::Virt::StoragePool::XML_INACTIVEβ Return XML describing the inactive state of the storage pool. inactive XML, still valid π
π LIST FILTERING π
The following constants are used to filter object lists.
Sys::Virt::StoragePool::LIST_ACTIVEβ Include storage pools which are active. active included βSys::Virt::StoragePool::LIST_INACTIVEβ Include storage pools which are inactive. inactive included π΄Sys::Virt::StoragePool::LIST_AUTOSTARTβ Include storage pools which are marked for autostart. autostart marked βSys::Virt::StoragePool::LIST_NO_AUTOSTARTβ Include storage pools which are not marked for autostart. no autostart π«Sys::Virt::StoragePool::LIST_PERSISTENTβ Include storage pools which are persistent. persistent included π¦Sys::Virt::StoragePool::LIST_TRANSIENTβ Include storage pools which are transient. transient included π¨Sys::Virt::StoragePool::LIST_DIRβ Include directory storage pools. directory pools πSys::Virt::StoragePool::LIST_DISKβ Include disk storage pools. disk pools π½Sys::Virt::StoragePool::LIST_FSβ Include filesystem storage pools. filesystem pools ποΈSys::Virt::StoragePool::LIST_ISCSIβ Include iSCSI storage pools. iSCSI pools πSys::Virt::StoragePool::LIST_LOGICALβ Include LVM storage pools. LVM pools π§±Sys::Virt::StoragePool::LIST_MPATHβ Include multipath storage pools. multipath pools π£οΈSys::Virt::StoragePool::LIST_NETFSβ Include network filesystem storage pools. network filesystem pools πSys::Virt::StoragePool::LIST_RBDβ Include RBD storage pools. RBD pools π£Sys::Virt::StoragePool::LIST_SCSIβ Include SCSI storage pools. SCSI pools πSys::Virt::StoragePool::LIST_SHEEPDOGβ Include sheepdog storage pools. sheepdog pools πSys::Virt::StoragePool::LIST_GLUSTERβ Include gluster storage pools. gluster pools π«Sys::Virt::StoragePool::LIST_ZFSβ Include ZFS storage pools. ZFS pools βοΈSys::Virt::StoragePool::LIST_VSTORAGEβ Include VStorage storage pools. VStorage pools π¦Sys::Virt::StoragePool::LIST_ISCSI_DIRECTβ Include direct iSCSI pools. direct iSCSI pools π―
π EVENT ID CONSTANTS π
Sys::Virt::StoragePool::EVENT_ID_LIFECYCLEβ Storage pool lifecycle events. lifecycle events πSys::Virt::StoragePool::EVENT_ID_REFRESHβ Storage pool volume refresh events. refresh events π§
π§ LIFECYCLE CHANGE EVENTS π§
The following constants allow storage pool lifecycle change events to be interpreted. The events contain both a state change, and a reason though the reason is currently unused.
Sys::Virt::StoragePool::EVENT_DEFINEDβ Indicates that a persistent configuration has been defined for the storage pool. defined, persistent config πSys::Virt::StoragePool::EVENT_STARTEDβ The storage pool has started running. started running βΆοΈSys::Virt::StoragePool::EVENT_STOPPEDβ The storage pool has stopped running. stopped running βΉοΈSys::Virt::StoragePool::EVENT_UNDEFINEDβ The persistent configuration has gone away. config gone π¨Sys::Virt::StoragePool::EVENT_CREATEDβ The underlying storage has been built. storage built π§±Sys::Virt::StoragePool::EVENT_DELETEDβ The underlying storage has been released. storage released ποΈ
π AUTHORS π
Daniel P. Berrange <berrange@redhat.com> shoutout to Daniel P. Berrange π«Ά
π COPYRIGHT π
Copyright (C) 2006-2009 Red Hat Copyright (C) 2006-2009 Daniel P. Berrange. copyright lines, preserved exactly π
πΈ LICENSE πΈ
This program is free software; you can redistribute it and/or modify it under the terms of either the GNU General Public License as published by the Free Software Foundation (either version 2 of the License, or at your option any later version), or, the Artistic License, as specified in the Perl README file.
β¨ SEE ALSO β¨
okay bestie, you're not done yet β here's where to go next π
Sys::Virtβ the main module, the mothership, the main character π this whole page is literally just one little corner of it, so go read it fr frSys::Virt::Errorβ when things go sideways (and they will π), this is the one holding the error info you're gonna want"http://libvirt.org"β the actual libvirt site, for when you wanna go straight to the source. no cap, it's giving reference material π¦
and that's a wrap, bestie!! π this page was brought to you by perl v5.40.2, dated 2026-06-08, living at Sys::V...gePool(3pm) β go forth and pool those storage volumes, you're gonna slay πβ¨π«Ά
π¦ where this page comes from
- epel 10: perl-Sys-Virt 12.4.0-1.el10_3 Β· GPL-2.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms