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

Common functions of vsphere Virtualization

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Frequently asked questions about ESXI hosts:

1. After the esxi host is successfully installed, the default time zone is utc time zone, which is modified to cst time zone.

1) Log in to the target ESXI host using vsphere client

2) configure-- > Security profile-- > Service-- > Properties-- > SSH-- > options-- > start

3) use xshell to remotely log in to the esxi host to copy the / etc/localtime file of the centos server to the / etc/localtime of the esxi host

4) use the date command to verify that the time zone has been changed successfully

5) make the following modifications to prevent restarting the time zone of the esxi host from changing back to utc

① copies the localtime file of the centos server to the host / vmfs/volumes/ storage directory

② modifies the esxi host boot script to copy the time zone file to the / etc directory every time it starts

# vi / etc/rc.local.d/local.sh cp-rf / vmfs/volumes/5d9e07de-d85a72fc-5a52-20040ff9f88e/localtime / etc/localtime chmod 777 / etc/localtime

2. Modify the default esxi host web access port

# cat / etc/vmware/rhttpproxy/config.xml | grep httpPort 80 # change 80 to another port

3. The problem that esxi hosts cannot log in to webclient alone after joining vcenter

F2-- > Configure Lockdown mode changed to disable

4. Online expansion of hard disk data disk without downtime of virtual machine

Description:

Operating system: CentOS

The disk capacity is 400GB. In the past, there was only one 400GB / opt partition, but now the / opt partition is no longer enough.

Requirements: expand the capacity of this disk online to 600GB, add the newly added 200GB to the previous / opt partition, and ensure that the original data of the / opt partition is not corrupted.

1) Log in to vcenter to increase the hard disk capacity of the target virtual machine

2) enable the system to re-recognize the hard disk capacity (this step omits the need to restart the server hard disk size to re-recognize it)

# ls / sys/class/scsi_disk/# echo 1 > / sys/class/scsi_disk/2\: 0: 1\: 0/device/rescan# fdisk-l

3) uninstall the disk and re-partition

① unmount disk

Umount-l / opt

If prompted that the disk is busy, use fuser to find out the program that will be using the disk and end it.

Fuser-m-v / opt

Fuser-m-v-I-k / opt

② disk partition

Use the fdisk command to resize disk partitions

Fdisk-l

Fdisk / dev/sdb

P # check the column number and remember, it will be used later.

D # delete the previous partition

N # create a new partition

P # Primary Partition

1 # first primary partition

Delete the previous partition, and then create a new partition, pay attention to the beginning of the column number to be consistent with the original (the key step to ensure that data is not lost), the end of the column number default enter to use all disks.

Wq # Save partition information and exit

③ adjust Partition

E2fsck-f / dev/sdb1 # check partition information

Resize2fs / dev/sdb1 # resize partitions

④ remounts the partition

Mount / dev/sdb1 / opt

Set up boot auto mount

Df-h # can see that the disk capacity has changed to 600GB

5. Virtual machine non-stop online expansion system disk root partition

Operating system: CentOS

The disk of the magnetic original system has 40GB and is all hung in the / directory. Now the / directory space is insufficient and the capacity needs to be expanded.

Requirements: expand the capacity of the original system disk 40GB to 50GB, and ensure that the server cannot be restarted and the original data of the partition will not be damaged.

1) Log in to vcenter to modify the hard disk capacity of the target virtual machine to 50GB

2) enable the system to re-recognize the hard disk capacity (this step omits the need to restart the server hard disk size to re-recognize it)

# fdisk-l # ls / sys/class/scsi_disk/# echo 1 > / sys/class/scsi_disk/2\: 0\: 1\: 0/device/rescan# fdisk-l

Disk partition

Use the fdisk command to resize disk partitions

# fdisk-l

# fdisk / dev/sda

P # check the column number and remember, it will be used later.

D # delete the previous partition

N # create a new partition

P # Primary Partition

1 # first primary partition

Delete the previous partition, and then create a new partition, pay attention to the beginning of the column number to be consistent with the original (the key step to ensure that data is not lost), the end of the column number default enter to use all disks.

Wq # Save partition information and exit

③ reloads the partition table, reidentifies the partition size, and verifies whether the disk expansion is successful or not

# partprobe

# xfs_growfs / dev/sda1

# df-hT

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