Category: vmware

  • vmware esxi 查询命令

    网卡信息查询

    [root@localhost2:~] esxcfg-nics -l
    Name    PCI          Driver      Link Speed      Duplex MAC Address       MTU    Description
    vmnic0  0000:01:00.0 ntg3        Up   1000Mbps   Full   c8:1f:66:f2:25:fc 1500   Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet
    vmnic1  0000:01:00.1 ntg3        Down 0Mbps      Half   c8:1f:66:f2:25:fd 1500   Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet
    vmnic2  0000:02:00.0 ntg3        Down 0Mbps      Half   c8:1f:66:f2:25:fe 1500   Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet
    vmnic3  0000:02:00.1 ntg3        Up   1000Mbps   Full   c8:1f:66:f2:25:ff 1500   Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet
    vmnic4  0000:04:00.0 ixgben      Down 0Mbps      Half   90:e2:ba:93:9f:58 1500   Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
    vmnic5  0000:04:00.1 ixgben      Up   10000Mbps  Full   90:e2:ba:93:9f:5a 1500   Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection
    

    获取主机总线适配器当前使用得驱动程序类型

    [root@localhost2:~] esxcfg-scsidevs -a
    vmhba0  vmw_ahci          link-n/a  sata.vmhba0                             (0000:00:1f.2) Intel Corporation Patsburg 6 Port SATA AHCI Controller
    vmhba1  lsi_mr3           link-n/a  sas.5c81f660f7636700                    (0000:03:00.0) LSI / Symbios Logic Dell PERC H710 Mini
    vmhba64 iscsi_vmk         online    iscsi.vmhba64                           iSCSI Software Adapter
    

    存储路径查询

    [root@localhost2:~] esxcli storage core path list
    sas.5c81f660f7636700-sas.605c95593ce97768-naa.6c81f660f7636700235c95593ce97768
       UID: sas.5c81f660f7636700-sas.605c95593ce97768-naa.6c81f660f7636700235c95593ce97768
       Runtime Name: vmhba1:C2:T2:L0
       Device: naa.6c81f660f7636700235c95593ce97768
       Device Display Name: Local DELL Disk (naa.6c81f660f7636700235c95593ce97768)
       Adapter: vmhba1
       Channel: 2
       Target: 2
       LUN: 0
       Plugin: NMP
       State: active
       Transport: sas
       Adapter Identifier: sas.5c81f660f7636700
       Target Identifier: sas.605c95593ce97768
       Adapter Transport Details: 5c81f660f7636700
       Target Transport Details: 605c95593ce97768
       Maximum IO Size: 262144
    
    sata.vmhba0-sata.0:4-mpx.vmhba0:C0:T4:L0
       UID: sata.vmhba0-sata.0:4-mpx.vmhba0:C0:T4:L0
    ...
    

    查询WWN号

    esxcli storage san iscsi list
    [root@localhost2:~] esxcli storage san iscsi list
       Adapter: vmhba64
       UID: iscsi.vmhba64
       Driver: iscsi_vmk
       State: online
       Description: iSCSI Software Adapter
    
    [root@localhost2:~] esxcli storage san iscsi list |grep UID
       UID: iscsi.vmhba64
    
    esxcli storage fc iscsi list
    esxcli storage san fc list |grep -E 'Node Name:|Port Name'
    

    query SCSI devices

    #List the devices currently registered with the PSA.
    esxcli storage core device list
    #List the SCSI stats for SCSI Devices in the system
    esxcli storage core device stats get
    
    
    #List all the SCSI paths on the system.
    esxcli storage core path list
    #List the SCSI stats for the SCSI Paths in the system.
    esxcli storage core path stats get
    
  • 虚拟机磁盘模式

    虚拟机磁盘模式

    资料来源

    备份快照

    • 有独立磁盘的虚拟机不能做内存快照,只能做普通快照
    • vmware 独立磁盘 不受快照影响

    磁盘模式

    模式 desc
    独立 – 持久 持久模式磁盘的行为与物理机上常规磁盘的行为相似。写入持久模式磁盘的所有数据都会永久性地写入磁盘。
    独立 – 非持久 关闭虚拟机电源或重置虚拟机时,对非持久模式磁盘的更改将丢失。使用非持久模式,您可以每次使用相同的虚拟磁盘状态重新启动虚拟机。对磁盘的更改会写入重做日志文件并从中读取,重做日志文件会在关闭虚拟机电源或重置虚拟机时被删除。

    (more…)

  • vmware虚拟机打开电源慢的排查思路

    文章来源:Solved: Problems with slow Power-on

    1. Run esxtop on the host where you start it up and look for high ready times on cpu, disk latencies for storage, or memory limits. Or check these values on the performance tab in vCenter – I prefer esxtop – it samples 4x as often by default and you can adjust the sample rate. Check vm properties in vClient as well as .vmx to make sure you do not have any limits set for this vm.

    2. Are these hosts all part of the same cluster?

    3. Do you use resource pools?

    4. Have you checked the logs on your host (var/log/… vmkernel, vmkwarning, as well as the vmware.log in the vm directory) ?

    5. What about the VM’s swap file? If the creation of that is slow, then the VM may take a long time to boot as well. Check to see where that is stored.

    6. Compare all of this VM’s settings to another VM that is not experiencing the problem.

    7. Does this happen with only 1 VM, a specific group of VM’s, or all of them? Does the slow boot vary across different VM types (cpus, memory, storage location, OS)?

    8. How many disks does this VM have? To power on the VM, the host has to write a lock entry on each lun the VM has disks on. Normally this takes a (1-2) MS, but if there is contention for lun meta updates (VMotions, VM power on, VM creation, snapshots growing) then this could delay the boot as well.

    9. What is the VM hardware version?

    10. VMTools up to date?
    11. Does the HAL match # of CPU’s?
  • vmware 无法删除快照

    vmware无法删除快照.

    使用vcenter 6.0 测试,关机情况下备份,出现:创建快照层次过深.
    尝试删除快照出现错误:

    A general system error occurred: vim.fault.GenericVmConfigFault

    解决方法

    1. 打开存储进入虚拟机所在目录.
    2. 创建临时目录,备份快照文件.
      mkdir ./tmp/
      mv *.vmsn ./tmp/
      mv *.vmsd ./tmp/
    3. 界面上点击删除全部快照.如果失败,重试
    4. 如果步骤3成功.进行磁盘整合.

    (more…)

  • 厚置备与精简置备

    厚置备延迟置零

    以默认的厚格式创建虚拟磁盘。创建虚拟磁盘时分配虚拟磁盘所需的空间。创建过程中不会清除物理设备上保留的数据,但以后首次从虚拟机写入时则会按需置零。

    厚置备置零

    一种厚虚拟磁盘类型,可支持群集功能,如 Fault Tolerance。在创建时为虚拟磁盘分配所需的空间。与厚置备延迟置零格式相反,创建虚拟磁盘时,会将物理设备上保留的数据置零。创建这种格式的磁盘所需的时间可能会比创建其他类型的磁盘长。

    精简置备

    使用此格式可节省存储空间。对于精简磁盘,可以根据输入的磁盘大小值置备磁盘所需的任意数据存储空间。但是,精简磁盘开始时很小,只使用与初始操作所需的大小完全相同的存储空间。

    关于虚拟磁盘置备策略