Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Add local storage on oVirt and distribute linux virtual machines

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

The oVirt platform has been built before. OVirt-engine and oVirt-node are both physical machines, and the operating system is centos7. There is only one 500GB hard drive. Now you need to add a local hard disk as storage, and enable the cluster to release virtual machines normally.

Confirmation information

First, make sure that the kvm host has been added.

Then confirm the cluster status in Compute-> Cluster and keep it by default.

Then confirm the status of the data center in the calculation-> data center and find that it is not initialized.

Because no storage has been added, the data center cannot be initialized, so we cannot issue virtual machines.

First modify the data center type and edit

Then change the storage type to local

Description:

1. The name and description can be filled in freely.

2. Storage type, local is using local hard disk, sharing is using shared storage, such as nfs,iscis, etc.

Configure local storage

Then start configuring the storage

Before configuring storage, you need to understand the concept of the storage domain below. The following is the official description (machine translation).

Prepare local storage

You can set up a local storage domain on the host. When you set up a host to use local storage, the host is automatically added to the new data center and cluster, but no other hosts can be added.

It must be noted that on oVirt-node, the path for local storage must be in the / var directory, and logical volumes are recommended

But use centos7, without this restriction, you can just find a partition.

First of all, make sure that the disk space mounted on the / var directory is enough, and if it is not enough, it needs to be expanded. Here is my space allocation.

I use the root directory directly

Mkdir-p / data/images-p

Ensure that the directory has read / write access to vdsm users (UID 36) and kvm groups (GID 36).

# chown 36:36 / data/ data/images # chmod 0755 / data/ data/images

This completes the addition of local storage

Then add local storage on the ovirt platform

Click calculate → hosts, and then select the host

Click manage → maintenance, and then click OK

Manage → configuration local storage.

Click the Edit button next to the data Center, Cluster, and Storage fields to configure and name the local storage domain.

Set the path to the local storage in the text input field as / data/images, and determine

Then store-domain to view the addition of your storage. If it is displayed, it means it is successful.

Due to the successful addition of storage, you can see the data center online at this time.

The storage has been added. The main purpose of this storage is to allocate virtual machine disks.

Configure the iso domain

The storage domain is to provide the virtual machine hard disk, and the ISO domain is to save the operating system ISO image to guide the installation of the virtual machine.

OVirt comes with an ISO domain by default, and the storage type is openstack glance, which cannot be used by us, so we need to add a new ISO domain.

(cannot be used, storage type is not compatible)

Query related documents. ISO domain can only upload ISO image using NFS mount. Although ISO domain can be created directly by using local hard disk, iso image cannot be uploaded. It is not clear why this is so.

Since I have only one server, I have decided that this server is configured as both a nfs server and a client. The configuration of the NFS server is not explained here. Mount the directory using / var/iso/

Yum install-y nfs-utilsvim / etc/exports/var/iso/ 192.168.3.0 exportfs 255.255.255.0 (rw) 127.0.0.1 rsystemctl start rpcbind.servicesystemctl start nfs-server.servicerpcinfo 255.255.255.255 (rw)

Once configured, oVirt requires specific system user accounts and system user groups, so Engine can store data in the storage domain represented by the exported directory.

Create users and groups

Groupadd kvm-g 36useradd vdsm-u 36-g 36

Change mount directory permissions and mode

Chown-R 36:36 / var/isochmod 0755 / var/iso

After the configuration is complete, add NFS storage on the ovirt platform

"in the Administration Portal, click Save → Domain." Then create a new one as follows

Click OK. The configuration is complete at this time

The data center automatically adds

Then enter at the host command line to upload the iso image to the ISO domain

Ovirt-iso-uploader-i nfs upload CentOS-7-x86_64-Minimal-1611.iso

Waiting for upload to be completed.

Then check to see if the ISO domain has an ISO image

Create a virtual machine

You can now create a virtual machine. Since we are a single network card server, we do not have to consider the virtual network configuration.

Re-calculate-in the virtual machine, click New

Then start to configure the virtual machine, there are many options, it is recommended to turn on the advanced option, you can configure the virtual machine in more detail

Proceed as follows

Description:

1. If there is no template, it is blank

2. Instance type, such as tiny small, etc. In fact, this is the specification of the virtual machine, because we do not configure the specification, so we choose to customize it.

3. Optimize the goal and choose the server, because we are not going to use the graphical desktop

Then configure the instance image, which refers to the hard disk of the virtual machine. We choose to create it, and then fill in it as follows.

Description:

1. Disk type can only be mirrored. Direct LUN can only be used when mounting san or ipsan. Cinder and manage block are both storage in openstack.

2. Disk size, as long as the allocation does not exceed the total size of the storage domain

3. Interface, that is, the hard disk bus type, linux can be directly used virtIO-scsi,windows may require virtIO

4. The allocation strategy can be simplified.

5. Note that the bootable one must be checked, because this block disk is used as a system disk, and the data disk can be unchecked.

Then enter the configuration system, because my physical machine performance is limited, basically according to the minimum configuration

Description:

1. The operating system can only choose linux, and there is no centos option. I don't know if Red Hat doesn't agree with centos.

2. If the memory size allocation is not clear, you can click the information to view the description.

3. Hardware time to ensure that the hardware clock of the bios motherboard is the same as the operating system clock. Select GMT + 8 here.

There are many other options. Depending on the configuration, my test environment does not need to be configured so much. The boot option must be configured here, otherwise the virtual machine cannot install the operating system.

Description:

1. The first boot option must be CD-ROM

2. Click add CD to load the ISO image.

Finally, don't forget to choose the network card.

Created

Then click run

MNP, my machine only has 4G memory.

There is not enough memory to release the virtual machine.

FFFFFFFF**K

It seems that I need to expand my memory to continue to play.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report