There is no new concept in this article. We just use command line tools to repeat what we have done before. There are no preconditions, they are all the same. The process, we have discussed the previous articles.
Step 1: Configure the storage pool
The Virsh command line tool is a user interface for managing virsh client domains. The virsh program can run the given command and its parameters on the command line.
In this section, we will use it to create a storage pool for our KVM environment. To find out more about this tool, use the following command.
# man virsh1. Use virsh with the pool-define-as command to define a new storage pool. You need to specify the name, type, and type parameters.
In this example, we take the name as Spool1 and the type is the directory. By default you can provide five parameters to this type:
For the directory type, we need to specify the path of the storage pool with the last parameter <;target”, we can use other parameters (“-” To fill.
# virsh pool-define-as Spool1 dir - - - - "/mnt/personal-data/SPool1/"
Create a new storage pool
>2. To view all of our storage pools in the environment, use the following command.
# virsh pool-list --all
List all storage pools
3. Now let’s construct the storage pool. Use the following command to construct the storage pool we just defined.
# virsh pool-build Spool1
Constructing a storage pool
4. Use the virsh command with the pool-start parameter to activate and Start the storage pool we just created and constructed.
# virsh pool-start Spool1
Activating a Storage Pool
5. To view the status of a storage pool in your environment, use the following command.
# virsh pool-list --all
View storage pool status
You will find that the status of Spool1 has become activated .
6. Configure Spool1 so that it can be started by the libvirtd service each time.
# virsh pool-autostart Spool1
Configuring KVM Storage Pools
7. Finally, take a look at our new storage pool information. Let's go.
# virsh pool-info Spool1
View KVM Storage Pool Information
Congratulations, Spool1 is ready to go, then we Try creating a storage volume to use it.
Step 2: Configure Storage Volume/Disk Image
Now it's time to disk image, create a new disk image in Spool1 with the qemu-img command. For more details, check out the man page.
# man qemu-img8. We should specify the operation after the qemu-img command, create, check, … & rdquo; and so on, the disk image format, the disk image you want to create Path and size.
# qemu-img create -f raw /mnt/personal-data/SPool1/SVol1.img 10G
Creating a Storage Volume
9. By using the qemu-img command with info, you can get some information about your new disk image.
View Storage Volume Information
Warning: Do not use the qemu-img command to modify a running virtual machine or any other process. The image used, the image will be destroyed.
It's time to create a virtual machine.
Step 3: Create a virtual machine
10. Now to the last step, in the final step, we will use the virt-install command to create a virtual machine. Virt-install is a command-line tool for creating new KVM virtual machines that uses the “libvirt” hypervisor library. For more details, you can also check out the man page.
# man virt-installTo create a new KVM virtual machine, you need to use the command with all the information below.
Name: The name of the virtual machine.
Disk Location: The location of the disk image.
Graphics : How to connect to a VM, usually SPICE.
vcpu : The number of virtual CPUs.
ram : The amount of allocated memory in megabytes.
Location : Specify the installation source path.
Network : Specifies a virtual network, usually a virbr0 bridge. virt-install –name=rhel7 –disk path=/mnt/personal-data/SPool1/SVol1.img –graphics spice –vcpu=1 –ram=
The following error message appears after starting vnc4server: LSPPC-Lenny:~# vnc4serverxauth: (stdi
As a Linux enthusiast, after several determinations, he gave up the dual system and installed Linux
JFS was developed by IBM and originally appeared on the AIX operating system, which provides a log-b
There is no new concept in this article. We just use command line tools to repeat what we have done
Linux network capture command tcpdump detailed
Retrieve the Linux superuser root password
Comparison of ext4 and ext3 under Linux
How to test hard disk read and write speed in Linux
Mysql installation considerations, five reasons for installation failure
How to manually clear or refresh the SWAP partition of Linux
Linux enthusiasts: share my vision of the Linux community
Microsoft said that Win10 hides black and white icon design is not easy
How does the start menu in win10 10547 preview show more tiles in the group?
Win7 computer sound icon is gone, how to do
Win7/Win8 traditional BIOS graphic installation SteamOS tutorial
Ten Windows 7 puzzles that SP1 can't solve
Prevent mail server poisoning firewall debut
How does the Win7 system refuse to read the USB flash drive? How to disable removable disk?