Expand Disk Linux Server without reboot 1. Find out which SCSI devices are involved: ls /sys/class/scsi_device/ Result example: 0:0:0:0 2:0:0:0 2:0:1:0 2. Provoke a re-sync of the kernel for all the SCSI devices (unless you know exactly which one is concerned). That also finds new disks if it’s the case. echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan echo 1 > /sys/class/scsi_device/2\:0\:1\:0/device/rescan 3. In case that doesn’t work you can tell the kernel to re-scan the already known disks only:Find out how many ‘hostX’ there are: ls /sys/class/scsi_host/ Result example: host0 host1 host2 4. Now rescan every host listed above: echo "- - -" > /sys/class/scsi_host/host0/scan echo "- - -" > /sys/class/scsi_host/host1/scan echo "- - -" > /sys/class/scsi_host/host2/scan 5. This should display a bigger size of the hard disk: fdisk -l 6. cfdisk /dev/sda (อาจต้อง run คำส้่ง partprobe หรือ partx -a /dev/sda เพื่อให้มองเห็น Disk /dev/sda3 ถ้าไม่ซีเรียสสามารถ Reboot VM โดยข้ามขั้นตอนนี้ได้) 7. pvcreate /dev/sda3 8. vgextend vg_centos6 /dev/sda3 9. lvextend /dev/vg_centos6/lv_root /dev/sda3 10. resize2fs /dev/vg_centos6/lv_root Disk ควรจะถูกเพิ่ม ตรวจสอบได้จาก df -h Add Disk Linux Server Without reboot 1. run command: #ls -l /sys/class/scsi_host/ Result example: # ls -l /sys/class/scsi_host/ total 0 lrwxrwxrwx 1 root root 0 2017-07-27 16:39 host0 -> ../../devices/pci0000:00/0000:00:07.1/host0/scsi_host/host0 lrwxrwxrwx 1 root root 0 2017-07-27 16:39 host1 -> ../../devices/pci0000:00/0000:00:07.1/host1/scsi_host/host1 lrwxrwxrwx 1 root root 0 2017-07-27 16:39 host2 -> ../../devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2 2. But to detect a new hard drive attached you need to first get your host bus number used which you can get by using below command #grep mpt /sys/class/scsi_host/host?/proc_name 3. You should get a output like below #grep mpt /sys/class/scsi_host/host2/proc_name mptspi 4. So as you see your host2 is the relevant fiels where you need to reset the storage buffer values. Run the below command # echo "- - -" > /sys/class/scsi_host/host2/scan *** Here "- - -" defines the three values stored inside host*/scan i.e. channel number, SCSI target ID, and LUN values. We are simply replacing the values with wild cards so that it can detect new changes attached to the Linux box. This procedure will add LUNs, but not remove them. # fdisk -l เราควรจะเจอ Disk หลังจากใช้คำสั่งนี้ # cfdisk /dev/sdb # fdisk -l # mkfs.ext4 /dev/sdb1 # fdisk -l # mount /dev/sdb1 /backup Expand Disk Windows Server without reboot 1. Expand Disk บน vSphere Client 2. In Computer Management, right-click Disk Management and click Rescan Disks. Ref: http://techgenix.com/how-extend-vsphere-windows-vm-disk-volume/
ปัญหา 1: Auto DHCP แจก IP ซ้ำกับ Addtional IP ที่ถูกใช้ไปแล้ว เช่น IP ที่ถูก Add เพิ่มบน cPanel (Main IP ไม่พบปัญหา) แก้ไข: ใช้วิธีการล็อค MAC Address หรือ Reservation IP บน DHCP Server โดยเมื่อจำเป็นต้อง Add IP เพิ่มเติมให้กับ VM ให้ใช้วิธีการ Edit Setting VM และ Add New device: Network วิธีการนี้จะทำให้ได้ค่า Mac Address และให้ดำเนินการ Reservation IP บน DHCP Server กำหนด Scope ขึ้นมาใหม่ โดยให้แบ่ง Scope ให้ชัดเจน เช่น Range ไหนให้กำหนดเป็น DHCP, Range ไหนให้เป็น Additional IP ปัญหา 2: IP ไม่ถูกลบออกจาก DHCP Server โดยอัติโนมัติ เมื่อเราลบ VM นั้นออกไปแล้ว แก้ไข: 1. กำหนดค่า Lease duration for DHCP clients ให้ต่ำ เพื่อให้ IP Address เรียกคืนค่า IP ที่ไม่ได้มีการใช้งานแล้ว 2. กรณีต้องการใช้ IP Address โดยทันที ให้ดำเนินการลบ IP Manual บน DHCP Server ที่ Address Leases
ปัญหา:
VM ใหม่ที่สร้างขึ้นจาก Template ไม่สามารถรับ Auto DHCP จาก DHCP Server ได้
การแก้ปัญหา:
เป็นปัญหาที่ Template โดยก่อนการ Convert เป็น Template ให้ดำเนินการลบบรรทัด Mac Address ที่ Interface ออกไปเช่น /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=
ปัญหา: Host หรือ Hypervisor แจ้ง Warning ว่า "System logs are stored on non-persistent storage" หมายความว่า System Logs ระบุ Path ไม่ถูกต้อง หากเราไม่ระบุ Path ระบบจะกำหนดให้เป็น Default เช่น /tmp หากมีการ Reboot ข้อมูล Logs ที่เก็บไว้ใน /tmp ทั้งหมดจะหายไป แก้ไข: 1. Login ไปที่ vSphere Web Client 2. คลิ๊กแท็ป Manage และไปที่ Settings 3. คลิ๊กที่ Advanced System Settings 4. ค้นหา Syslog.global.logDir และระบุ Path ให้ถูกต้อง เช่น [ISO] SystemLog01 Note: จำเป็นต้อง Reboot เพื่อให้การเปลี่ยนแปลงมีผล อ้างอิง: https://kb.vmware.com/s/article/2032823
ปัญหา: เมื่อ Reboot เครื่อง Host บน vCenter แต่พบปัญหาว่า Host บน vCenter ยังไม่ Active หรือขึ้น Error not responding และมี Error บน ESXi Host ว่า "cannot login vpxuser@127.0.0.1" ***vpxuser คือ Account ที่จะถูกสร้างขั้นเมื่อมีการ Connect จาก vCenter ไปที่ ESXi Host แก้ไข: ต้อง Disconnect และ Connect ใหม่ มีวิธีการดังนี้ 1. Login เข้า vSphere Web Client 2. คลิ๊กขวาที่ ESXi Host >> Connection >> Disconnect (อย่า remove ESXi host) 3. Connect ใหม่อีกครั้ง โดย คลิ๊กขวาที่ ESXi Host >> Connection >> Connect 4. ระบุ User Root, Password สำหรับ ESXi Host ที่ต้องการ Connect 5. ตรวจสอบ ESXi Host จะต้องไม่มี Error อ้างอิง: https://kb.vmware.com/s/article/1005759