Este contenido no está disponible en el idioma seleccionado.
12.4. LVM-based Storage Pools
Note
Note
Warning
12.4.1. Creating an LVM-based Storage Pool with virt-manager Copiar enlaceEnlace copiado en el portapapeles!
Optional: Create new partition for LVM volumes
These steps describe how to create a new partition and LVM volume group on a new hard disk drive.Warning
This procedure will remove all data from the selected storage device.Create a new partition
Use thefdiskcommand to create a new disk partition from the command line. The following example creates a new partition that uses the entire disk on the storage device/dev/sdb.fdisk /dev/sdb
# fdisk /dev/sdb Command (m for help):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Pressnfor a new partition.- Press
pfor a primary partition.Command action e extended p primary partition (1-4)
Command action e extended p primary partition (1-4)Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Choose an available partition number. In this example the first partition is chosen by entering
1.Partition number (1-4): 1
Partition number (1-4): 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enter the default first cylinder by pressing
Enter.First cylinder (1-400, default 1):
First cylinder (1-400, default 1):Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Select the size of the partition. In this example the entire disk is allocated by pressing
Enter.Last cylinder or +size or +sizeM or +sizeK (2-400, default 400):
Last cylinder or +size or +sizeM or +sizeK (2-400, default 400):Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the type of partition by pressing
t.Command (m for help): t
Command (m for help): tCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Choose the partition you created in the previous steps. In this example, the partition number is
1.Partition number (1-4): 1
Partition number (1-4): 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enter
8efor a Linux LVM partition.Hex code (type L to list codes): 8e
Hex code (type L to list codes): 8eCopy to Clipboard Copied! Toggle word wrap Toggle overflow - write changes to disk and quit.
Command (m for help): w Command (m for help): q
Command (m for help): w Command (m for help): qCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a new LVM volume group
Create a new LVM volume group with thevgcreatecommand. This example creates a volume group named guest_images_lvm.vgcreate guest_images_lvm /dev/sdb1
# vgcreate guest_images_lvm /dev/sdb1 Physical volume "/dev/vdb1" successfully created Volume group "guest_images_lvm" successfully createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The new LVM volume group, guest_images_lvm, can now be used for an LVM-based storage pool.Open the storage pool settings
- In the
virt-managergraphical interface, select the host from the main window.Open the Edit menu and select Connection DetailsFigure 12.12. Connection details
- Click on the Storage tab.
Figure 12.13. Storage tab
Create the new storage pool
Start the Wizard
Press the + button (the add pool button). The Add a New Storage Pool wizard appears.Choose a for the storage pool. We use guest_images_lvm for this example. Then change the tological: LVM Volume Group, andFigure 12.14. Add LVM storage pool
Press the button to continue.Add a new pool (part 2)
Change the field. This example uses /guest_images.Now fill in the and fields, then tick the check box.- Use the field to either select an existing LVM volume group or as the name for a new volume group. The default format is
/dev/storage_pool_name.This example uses a new volume group named /dev/guest_images_lvm. - The
Source Pathfield is optional if an existing LVM volume group is used in the .For new LVM volume groups, input the location of a storage device in theSource Pathfield. This example uses a blank partition /dev/sdc. - The check box instructs
virt-managerto create a new LVM volume group. If you are using an existing volume group you should not select the check box.This example is using a blank partition to create a new volume group so the check box must be selected.
Figure 12.15. Add target and source
Verify the details and press the button format the LVM volume group and create the storage pool.Confirm the device to be formatted
A warning message appears.Figure 12.16. Warning message
Press the Yes button to proceed to erase all data on the storage device and create the storage pool.
Verify the new storage pool
The new storage pool will appear in the list on the left after a few seconds. Verify the details are what you expect, 465.76 GB Free in our example. Also verify the field reports the new storage pool as Active.It is generally a good idea to have the check box enabled, to ensure the storage pool starts automatically with libvirtd.Figure 12.17. Confirm LVM storage pool details
Close the Host Details dialog, as the task is now complete.