[VMware] 收集ESXi Log 厭煩老是用WinSCP,能否無需Third-Party Tools取得

厭煩手邊老是忘了準備WinSCP 或還要丟 /var/log/底下到 Datastore 可以看到目錄去收集目錄,其實現在老早就可以用網頁方式直接下載。

Resolution:

step01.
https://ESXi-IP/host

step02.
輸入 root / esxi-password

step03.

esxi.jpg

[VMware] ESXi Configuration Issues “No coredump target has been configured. Host core dumps cannot be saved “

客戶近日二台新機Cisco UCS C200 M4 , ESXi 6.0出現了如下圖所示 Configuration Issues “No coredump target has been configured. Host core dumps cannot be saved "

vmware-configuration-issues-no-coredump-target-has-been-configured.jpg

(極不建議) 若不想要CoreDump則是可以忽略;而忽略方式為
> Host > Configuration > Advanced Settings > UserVars > SuppressCoredumpWarning “1″

 


Reference :

  1. Configuring a diagnostic coredump partition on an ESXi 5.x/6.x host (2004299)
  2. Provirtualzone – VMware: ESXi 5.5 update – No coredump target has been configured. Host core dumps cannot be saved
  3. TUX ROOT – Disable “No Coredump Target has been Configured. Host Core Dumps Cannot be Saved” Error on ESXi host
  4. 9to5it.com – Fix – No coredump target has been configured

[VMware] vCSA 6.5.x how to remove orphaned virtual machine

** ready PowerCLI 6.5 U1 or above **

在管理VM時發現有二台vCSA(orphaned)孤立狀況且無法使用GUI delete or remove .

orphaned-vm-001.jpg

Workaround > use PowerCLI

step01. open PowerCLI

step02.
%:\> Connect-VIserver -Server 10.10.10.200 -User {account} -Password {password}

step03.
%:\> Get-VM | select name | findstr /i “VMware vCenter Server Appliance*"

step04.
%:\> Remove-VM “VMware vCenter Server Appliance (1)"
%:\> Remove-VM “VMware vCenter Server Appliance"

Done.


(未實驗過)
vim-cmd /vmsvc/getallvms // get vmid

vim-cmd /vmsvc/unregister <Vmid>


Reference :

  1. VMware Cmdlet Reference
  2. HEX64 – How To Remove Invalid VMs From ESXi Using CLI
  3. VMware KB:1011468 – Deleting an orphaned virtual machine when the Remove option is not available
  4. ALTARO – How to deal with orphaned virtual machines

[VMware] Reclaim disk space Datastore & VM

若虛擬機器空間使用所謂 ‘ Thin Provisioned ‘ 常會遇到當初劃分500GB空間時,則是慢慢增長加大。當然對該虛擬機器的.vmdk也是正向增長。但會遇到一個問題是明明OS層佔用空間已達400GB時另外刪了將近200GB,卻發現.vmdk還是未減少。這是因為未將OS層作所謂空間回收(Reclaim)動作.

Resolution:

@OS level
[Windows] 下載 SDelete工具
01. cmd.exe
02. sdelete.exe -c –z [driver-letter]
PS:
-c > Clean free space. Specify an option amount of space to leave free for use by a running system.
z > Zero free space (good for virtual disk optimization)

利用vmwar-tools 工具需以administrator最高權限才能執行
01. “C:\Program Files\VMware\VMware Tools\VMwareToolboxCmd.exe" disk shrink c:\ d:\
[Linux]
利用vmwar-tools 工具需以root最高權限才能執行
# vmware-toolbox-cmd disk shrink {mount-point}
-RedHat series
# dd if=/dev/zero of=/[mounted-volume]/zeroes && rm -f /[mounted-volume]/zeroes

# sudo dd if=/dev/zero of=zero.file ; rm -f zero.dat

# cat /dev/zero > zero.dat; rm -f zero.dat

若是VMware Workstation
–GUI–
Disk Utilities > Compact

–CLI–先重組後壓縮

“C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -r  -k D:\VM\test.vmdk -t 0 D:\VM\test-shrink.vmdk // PS: -r 重組 ; -k shrink

@Host level
PS: 可以online
最後在datastore再作個動作即達到整體瘦身囉
* 利用vMotion datastore 轉換過程為 ‘ Thin Provisioned

PS: 需關機才能作動
* ssh esxi
# vmkfstools -K /vmfs/volumes/{datastore-name}/{vm}/{vm}.vmdk

 

@針對LUN是Thin provisioning的話

check#1. esxcli storage core device vaai status get -d {naa.xxxxxxxxxxxxxxxxxxxxxxx} // 查看 Zero Status: support
check#2. esxcli storage core device list -d {naa.xxxxxxxxxxxxxxxxxxxxxxxx} // 查看Thin Provisioning Status:support

ESXi 5.0前用 vmkfstools -y

ESXi5.1~後用 esxcli storage vmfs unmap –volume-label=volume_label | –volume-uuid=volume_uuid (–reclaim-unit=number)
*sample*
# esxcli storage vmfs extent list

# esxcli storage vmfs unmap –volume-label=VM_Datastore
Devices backing volume 560e3db4-a6c9df25-6756-e41f132d2b98 do not support UNMAP
以上來看不支援此storage ;因為在check#1 得知它可能不是thin provisioning format


Reference:

  1. Master Dragon 的 Wiki – VMware Virtual Disk Shrink 將vmdk檔案縮小
  2. D R Y ! -geek~ VMWare 回收磁盘空间
  3. Black Manticore – Reclaim disk space from thin provisioned VMDK files in ESX
  4. vswitchzero – Using SDelete and vmkfstools to Reclaim Thin VMDK Space
  5. VMware Docs – 壓縮虛擬磁碟
  6. How to reclaim VMFS deleted blocks on thin-provisioned LUNs (2014849)
  7. sysadmintutorials.com – How to Reclaim Free Block Space from a Lun with VMware vSphere 5.5 and Netapp Cluster Mode

[VMware] How to install vCSA 6.5 & 6.7 on Workstation

step01. extract vCSA iso , into \vcsa\VMware-vCenter-Server-Appliance-6.7.0.12000-8832884_OVF10.ova

step02. Workstation open %\vcsa\VMware-vCenter-Server-Appliance-6.7.0.12000-8832884_OVF10.ova

step03.
匯入好之後暫不要開機

step04.
編輯 .vmx加入
——————————————————————————————-
guestinfo.cis.appliance.net.addr.family = “ipv4″
guestinfo.cis.appliance.net.mode = “static"
guestinfo.cis.appliance.net.pnid = “vcsa67.homelab.local"
guestinfo.cis.appliance.net.addr = “10.1.110.88″
guestinfo.cis.appliance.net.prefix = “24″
guestinfo.cis.appliance.net.gateway = “10.1.110.253″
guestinfo.cis.appliance.net.dns.servers = “10.1.130.1″
guestinfo.cis.appliance.root.passwd = “P@ssw0rd"
guestinfo.cis.appliance.ssh.enabled = “True"
guestinfo.cis.deployment.autoconfig = “True"
guestinfo.cis.appliance.ntp.servers = “time4.google.com"
guestinfo.cis.vmdir.password = “P@ssw0rd"
guestinfo.cis.vmdir.site-name = “default-site"
guestinfo.cis.vmdir.domain-name = “homelab.local"
——————————————————————————————-
PS: 發現以上有餵食失敗幾行 e.g.
guestinfo.cis.appliance.root.passwd = “P@ssw0rd"
guestinfo.cis.vmdir.password = “P@ssw0rd"
在開機後會發現密碼無法登入需重新reset

step05.Power-on vCSA

step06.Waiting os enter success

step07.Reset root password

step08.登入時看到畫面按下 ‘e’

step09.在 Linux開頭最後面按下 end 跳到後面 加入 rw init=/bin/bash

step10.按下 ‘F10’ boot

step11. // 建議作一下免後重置密碼無效
> ls -sh /var/log/audit
rm /var/log/audit/*.log

step12.
> whoami // check account is root
> passwd

step13.
umount /

step14.
reboot -f

step15.
confirm root account can login

step17.
https://10.1.110.88:5480 // start initiate

step18.
需調入 SSO domain , 最後即需一段時間即完成stage2

Done.


Reference:

  1. vmwarearena – How to Deploy vCenter Server appliance 6.5 on VMware Workstation 14
  2. enterprisedaddy – Deploy VCSA 6.5 on Workstation
  3. VMware KB: 2147144 – How to reset the lost or forgotten root password in vCenter Server Appliance 6.5

[VMware] import VDP 6.1.x error ‘The OVF package is signed with an invalid certificate ( 簽署 OVF 套件所用的憑證無效 )

在滙入 vDP 6.1.4時發生如下畫面錯誤訊息 " The OVF package is signed with an invalid certificate ( 簽署 OVF 套件所用的憑證無效 ) "

試解無效:

1.匯入"Publisher EMC Corporation"提供憑證也無解

2.匯入vCenter提供也是不行.

尋求Google大神總結有三個方式

vdp-error-invalid-certificate.jpg

Method#1. 改用 HTML5方式來匯入是最快方式

Method#2. 用7-zip 打開 .ova刪除裡頭的 .mf檔案

Method#3. 利用 ovftool工具轉換 , 載點
ovftool.exe –skipManifestCheck c:\tmp\vSphereDataProtection-6.1.5.ova c:\vdpfix.ova

[VMware] Cannot power-on VM ‘A general system error occurred: No connection could be made because the target machine actively refused it(發生一般系統錯誤:無法連線,因為目標電腦拒絕連線)

有人反應一台虛擬機器匯人後無法開機,會出現如下錯誤訊息

Solution:

~vCS~

services.msc > VMware vCenter workflow manager service > Start

~vCSA~
> service vmware-vpx-workflow restart

> shell.set –enabled true
> service-control –status vmware-vpx-workflow // check status
> service-control –start vmware-vpx-workflow

最後再試著Power-on VM , enjoy


Reference:

  1. VMware KB 2118319 : A general system error occurred: No connection could be made because the target machine actively refused it” error when powering on VMs on vCenter Server 6.0
  2. ISHM Blog : VM 在 vCenter 6 無法開機,發生 A general system error occurred: Connection refused

[VMware] VDP change backup transport method

VDP預設 transport method優先順序是先採用 1.Hot-Add 接著是 2.NBDSSL ,其次是 3.NBD

~Solution~

step01. vi /usr/local/avamarclient/var/avvcbimage.cmd

step02. add as below , 利用":"來區隔開
————————————————–
–transport=hotadd:nbd:nbdssl
————————————————–

step03. restart service
service avagent restart // VDP 5.x
service avagent-vmware restart  // VDP 6.x


Reference :
VMware KB: 2061083 – Changing the default and alternate transport methods in vSphere Data Protection (VDP)

[VERITAS] Backup Exec 2012 error ‘0xe00095a7 作業失敗,因為vCenter 或 ESX 伺服器報告虛擬機器的組態無效 ‘

客戶反應BE2012備份ESXi5.1 fail as below screen
BE-error-0xE00095A7.jpg

Solution#1
Restart the Vmware tools service on the Guest Virtual machine being backed up and try to run the Backup job

Solution#2
Disable the VMware Filesystem Sync Driver and Volume Shadow Copy Services Support on the affected Guest VM and try the job

step01. Start the VMware Tools Install/Upgrade from the vCenter/vSphere console/client
step02. interactive Tools Upgrade
step03. modify
step04. expand “VMware Device Drivers (VMware裝置驅動程式)"
step05. uninstall / cancel
(x) “Volume Shadow Copy Services Support(磁碟區陰影複製服務支援)"
(x)"Filesystem Sync Driver (文件系統同步驅動程式)" // <–這僅在ESX4.1前才會有

Solution#3 (若Media Server是虛擬機器的話)
1. Uninstall the Agent for VMWare Virtual Infrastructure(AVVI) option from Tools-> Install Options And License Keys On This Media Server
2. Reinstall the AVVI option from Tools-> Install Options And License Keys On This Media Server
3. Run the backup job again

 


Reference :

  1. VERITAS Article ID: 100002894
  2. VMware KB: 2087880

[VMware] How to Enable VMs eachother Clipboard Copy and Paste function

Solution#1 for A-VM with B-VM eachother

Modify 2 VMs .vmx add as below
————————————————————————
isolation.tools.copy.disable   FALSE
isolation.tools.paste.disable FALSE
————————————————————————

Solution#2 for All VMs of the Hosts

step01. login ESX/ESXi host

step02. cp /etc/vmware/config /etc/vmware/config.bak // before modify to backup it!

step03. vi /etc/vmware/config , Add these entries to the file
——————————————————————————————–
isolation.tools.copy.disable="FALSE"
isolation.tools.paste.disable="FALSE"
——————————————————————————————–

 


 

Reference :
VMware KB 1026437 – Clipboard Copy and Paste does not work in vSphere Client 4.1 and later