首页 > 代码库 > vmkfstools释放空闲存储命令

vmkfstools释放空闲存储命令

事件描述:我们的虚拟化是防火墙,虚拟化交换机,三台服务器,一台raid50,  12块硬盘存储,开始是发现是几乎所有服务器无法登陆,中心管理机器也不能登录能登录的服务器命令基础命令都不能用,数据库也没了,然后就怀疑是黑客黑了我们,但是又不像,最后发现服务器不能写,就想着是虚拟化系统软件或存储存储服务器坏了,经过和戴尔售后确认不是硬件问题,接着就排查虚拟化,找到是服务器建的太多,镜像备份太大存储写爆了,处理方法是你弄虚拟化的话,一个专门备份用的机器要单独挂个硬盘,还有那个虚拟化管理机器最好也单独弄个硬盘,不像我们中心管理机也都用的存储,存储坏了,中心控制机也登不了 ;最后处理,删除空闲机器,但是从磁盘删除后,占用存储并没有释放,下面就是vmkfstools释放空闲存储命令

ssh -px  root@存储

列出设备信息esxcli storage core path list


监测是否支持vmkfstools

esxcli storage core device vaai status get -d naa.6019cbe163c74fb1a017256e2e9bc457


释放空闲存储大小

# cd /vmfs/volumes/volume_name

# vmkfstools -y percentage_of_deleted_blocks_to_reclaim

vmkfstools -y 60释放空闲存储空间的百分之60大小






/dev # esxcli storage core path list

iqn.1998-01.com.vmware:localhost-6a2369da-00023d000003,iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-01,t,1-


naa.6019cbe163c74fb1a017256e2e9bc457

   UID: iqn.1998-01.com.vmware:localhost-6a2369da-00023d000003,iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-


01,t,1-naa.6019cbe163c74fb1a017256e2e9bc457

   Runtime Name: vmhba38:C1:T1:L0

   Device: naa.6019cbe163c74fb1a017256e2e9bc457

   Device Display Name: EQLOGIC iSCSI Disk (naa.6019cbe163c74fb1a017256e2e9bc457)

   Adapter: vmhba38

   Channel: 1

   Target: 1

   LUN: 0

   Plugin: NMP

   State: active

   Transport: iscsi

   Adapter Identifier: iqn.1998-01.com.vmware:localhost-6a2369da

   Target Identifier: 00023d000003,iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-01,t,1

   Adapter Transport Details: iqn.1998-01.com.vmware:localhost-6a2369da

   Target Transport Details: IQN=iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-01 Alias= Session=00023d000003 


PortalTag=1

   Maximum IO Size: 131072


iqn.1998-01.com.vmware:localhost-6a2369da-00023d000002,iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-01,t,1-


naa.6019cbe163c74fb1a017256e2e9bc457

   UID: iqn.1998-01.com.vmware:localhost-6a2369da-00023d000002,iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-


01,t,1-naa.6019cbe163c74fb1a017256e2e9bc457

   Runtime Name: vmhba38:C0:T1:L0

   Device: naa.6019cbe163c74fb1a017256e2e9bc457

   Device Display Name: EQLOGIC iSCSI Disk (naa.6019cbe163c74fb1a017256e2e9bc457)

   Adapter: vmhba38

   Channel: 0

   Target: 1

   LUN: 0

   Plugin: NMP

   State: active

   Transport: iscsi

   Adapter Identifier: iqn.1998-01.com.vmware:localhost-6a2369da

   Target Identifier: 00023d000002,iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-01,t,1

   Adapter Transport Details: iqn.1998-01.com.vmware:localhost-6a2369da

   Target Transport Details: IQN=iqn.2001-05.com.equallogic:0-1cb196-b14fc763e-57c49b2e6e2517a0-vcsrv-01 Alias= Session=00023d000002 


PortalTag=1

   Maximum IO Size: 131072


usb.vmhba32-usb.0:0-mpx.vmhba32:C0:T0:L0

   UID: usb.vmhba32-usb.0:0-mpx.vmhba32:C0:T0:L0

   Runtime Name: vmhba32:C0:T0:L0

   Device: mpx.vmhba32:C0:T0:L0

   Device Display Name: Local USB Direct-Access (mpx.vmhba32:C0:T0:L0)

   Adapter: vmhba32

   Channel: 0

   Target: 0

   LUN: 0

   Plugin: NMP

   State: active

   Transport: usb

   Adapter Identifier: usb.vmhba32

   Target Identifier: usb.0:0

   Adapter Transport Details: Unavailable or path is unclaimed

   Target Transport Details: Unavailable or path is unclaimed

   Maximum IO Size: 122880


iqn.1998-01.com.vmware:localhost-6a2369da-00023d000002,iqn.2001-05.com.equallogic:0-1cb196-13cfc763e-1d149b39326518eb-log,t,1-


naa.6019cbe163c7cf13eb186532399b141d

   UID: iqn.1998-01.com.vmware:localhost-6a2369da-00023d000002,iqn.2001-05.com.equallogic:0-1cb196-13cfc763e-1d149b39326518eb-


log,t,1-naa.6019cbe163c7cf13eb186532399b141d

   Runtime Name: vmhba38:C1:T2:L0

   Device: naa.6019cbe163c7cf13eb186532399b141d

   Device Display Name: EQLOGIC iSCSI Disk (naa.6019cbe163c7cf13eb186532399b141d)

   Adapter: vmhba38

   Channel: 1

   Target: 2

   LUN: 0

   Plugin: NMP

   State: active

   Transport: iscsi

   Adapter Identifier: iqn.1998-01.com.vmware:localhost-6a2369da

   Target Identifier: 00023d000002,iqn.2001-05.com.equallogic:0-1cb196-13cfc763e-1d149b39326518eb-log,t,1

   Adapter Transport Details: iqn.1998-01.com.vmware:localhost-6a2369da

   Target Transport Details: IQN=iqn.2001-05.com.equallogic:0-1cb196-13cfc763e-1d149b39326518eb-log Alias= Session=00023d000002 


PortalTag=1

   Maximum IO Size: 131072


sata.vmhba36-sata.0:0-mpx.vmhba36:C0:T0:L0

   UID: sata.vmhba36-sata.0:0-mpx.vmhba36:C0:T0:L0

   Runtime Name: vmhba36:C0:T0:L0

   Device: mpx.vmhba36:C0:T0:L0

   Device Display Name: Local TSSTcorp CD-ROM (mpx.vmhba36:C0:T0:L0)

   Adapter: vmhba36

   Channel: 0

   Target: 0

   LUN: 0

   Plugin: NMP

   State: active

   Transport: sata

   Adapter Identifier: sata.vmhba36

   Target Identifier: sata.0:0

   Adapter Transport Details: Unavailable or path is unclaimed

   Target Transport Details: Unavailable or path is unclaimed

   Maximum IO Size: 131072

/dev # esxcli storage core path list |grep naaa

/dev # esxcli storage core path list |grep EQLOGIC

   Device Display Name: EQLOGIC iSCSI Disk (naa.6019cbe163c74fb1a017256e2e9bc457)

   Device Display Name: EQLOGIC iSCSI Disk (naa.6019cbe163c74fb1a017256e2e9bc457)

   Device Display Name: EQLOGIC iSCSI Disk (naa.6019cbe163c7cf13eb186532399b141d)

/dev # esxcli storage core device vaai status get -d naa.6019cbe163c74fb1a017256e2e9bc457

naa.6019cbe163c74fb1a017256e2e9bc457

   VAAI Plugin Name: VMW_VAAIP_EQL

   ATS Status: supported

   Clone Status: supported

   Zero Status: supported

   Delete Status: supported


vmkfstools释放空闲存储命令