Product SiteDocumentation Site

Chapter 27.  Volumes

27.1. Creating volumes
27.2. Cloning volumes
27.3. Adding storage devices to guests
27.3.1. Adding file based storage to a guest
27.3.2. Adding hard drives and other block devices to a guest
27.4. Deleting and removing volumes

27.1. Creating volumes

This section shows how to create disk volumes inside a block based storage pool.
# virsh vol-create-as guest_images_disk volume1 8G
Vol volume1 created

# virsh vol-create-as guest_images_disk volume2 8G
Vol volume2 created

# virsh vol-create-as guest_images_disk volume3 8G
Vol volume3 created

# virsh vol-list guest_images_disk
Name                 Path
-----------------------------------------
volume1              /dev/sdb1
volume2              /dev/sdb2
volume3              /dev/sdb3

# parted -s /dev/sdb print
Model: ATA ST3500418AS (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
2      17.4kB  8590MB  8590MB               primary
3      8590MB  17.2GB  8590MB               primary
1      21.5GB  30.1GB  8590MB               primary

#