[VMware] Backup / Restore vCenter Server 6.x vPostgres database

[ Windows ]

~備份(Backup)~

step01.
cd %VMWARE_CIS_HOME%\bin

cd C:\"Program Files"\VMware\"vCenter Server"\bin

step02. 需先停止 vmware-vpxdvmware-vdcs 服務
~6.7 and 6.5 (Windows)~
service-control –stop vpxd
service-control –stop content-library

~ 6.0 (Windows)~
service-control –stop vpxd
service-control –stop vdcs

step03.
下載KB Attachments , 載點
備份批次檔 > backup_win.py
還原批次檔 > restore_win.py

step04.
建立C槽底下一個目錄 tmp
C:\tmp將批次檔放置這兒

step05.
(Caution) 在執行批次檔請勿任意停止將會影響 PostgreSQL Database不一致。
找出  %VMWARE_CFG_DIR%\vmware-vpx\ 底下 vcdb.properties 記錄下 DB帳號 vc 的密碼

step06. 備份 (Backup)
cd %VMWARE_CIS_HOME%\Python\
python.exe c:\tmp\backup_win.py -p “oMfcT=7C?5L&Wh@2″ -f c:\tmp\backup_VCDB.bak
** 成功就會如下訊息**
Backup completed successfully.

step07. 最後別忘了啟動這二支 vmware-vpxdvmware-vdcs 服務
~6.7 and 6.5 (Windows)~
service-control –start vpxd
service-control –start content-library

~ 6.0 (Windows)~
service-control –start vpxd
service-control –start vdcs


~還原(Restore)~

step01.
請以 administrator 權限身份登入

step02.需先停止 vmware-vpxdvmware-vdcs 服務
~6.7 and 6.5 (Windows)~
service-control –stop vpxd
service-control –stop content-library

~ 6.0 (Windows)~
service-control –stop vpxd
service-control –stop vdcs

step03.
(Caution) 在執行批次檔請勿任意停止將會影響 PostgreSQL Database不一致。
找出  %VMWARE_CFG_DIR%\vmware-vpx\ 底下 vcdb.properties 記錄下 DB帳號 vc 的密碼

step04. 還原 (Restore)
cd %VMWARE_CIS_HOME%\Python\
python.exe c:\tmp\restore_win.py -p “oMfcT=7C?5L&Wh@2″ -f c:\tmp\backup_VCDB.bak
** 成功就會如下訊息**
Backup completed successfully.

step05. 最後別忘了啟動這二支 vmware-vpxdvmware-vdcs 服務
~6.7 and 6.5 (Windows)~
service-control –start vpxd
service-control –start content-library

~ 6.0 (Windows)~
service-control –start vpxd
service-control –start vdcs





[ Linux (Appliance) ]
與 Windows 差異是多了change mode
chmod 700 /tmp/backup_lin.py
chmod 700 /tmp/restore_lin.py


Reference :
1. Back up and restore vCenter Server Appliance/vCenter Server 6.x vPostgres database (2091961)

[VMware] vRealize Operations Manager 6.3 ~ 7.5 Enable SSH service

vRealize Operations Manager 6.x 基本上OS底層是 SUSE Linux Enterprise 11。所以尚未像 vCenter Appliance 是以 VMware Photon OS ;所以不是用VMware式的按下 ALT + F2 進入啟用SSH。

step01. open vROM console

step02. ALT + F1

step03. 預設帳號 ‘ root ‘ ,密碼 ‘空白 (blank)’ 按下後立即輸設定新密碼。

step04. # service sshd start

step05. # chkconfig sshd on

step06. use like ‘putty’ testing

Reference :

VMware KB – Enabling SSH access in vRealize Operations Manager 6.x and later (210051

vGyan.in : vRealize Part 7 – Enable SSH on vROPS

[VMware] vRealize Operations Manager 6.0 ~ 7.0 change IP

更改IP不單單只是變更一組IP重啟服務即可。

Resolution :

step01. Guest shutdown vRealize Operations Manager machine

step02. Edit Settings > Options > vApp Options > Properties > 輸入新 IP / 新的Gateway

step03. Power-on vRealize Operations Manager machine

step04. /opt/vmware/share/vami/vami_config_net // 輸入新IP

step05. Guest Restart Realize Operations Manager machine

step06. service vmware-casa stop

step07. /storage/db/casa/webapp/hsqldb/casa.db.script

step08. service vmware-casa start

step09. cd /usr/lib/vmware-vcopssuite/utilities/sliceConfiguration/bin

step10. $VMWARE_PYTHON_BIN ./vcopsConfigureRoles.py –adminCS=新的IP

step11. 更改以下三個位置有舊IP都置換成新IP
/usr/lib/vmware-vcopssuite/utilities/sliceConfiguration/data/roleState.properties

/usr/lib/vmware-vcops/user/conf/gemfire.properties

/usr/lib/vmware-vcops/user/conf/persistence/persistence.properties

/usr/lib/vmware-vcops/user/conf/gemfire.locator.properties

/usr/lib/vmware-vcops/user/conf/gemfire.native.properties

step12. service vmware-casa stop

step13. cp /usr/lib/vmware-vcops/user/conf/cis.properties /usr/lib/vmware-vcops/user/conf/cis.properties.bak

step14. vi /usr/lib/vmware-vcops/user/conf/cis.properties 置換成新IP

step15. vi /etc/hosts 置換成新IP

step16. service vmware-casa start

step17. Log in to vRealize Operations Manager admin UI as the local admin user

step18. Click Bring Online under Cluster Status

** vROM 6.1 and up **
vi /usr/lib/vmware-vcops/user/conf/cassandra/cassandra.yaml 置換成新IP

** vROM 6.7 and up **
vi /etc/apache2/listen.conf 置換成新IP

Reference :
1. VMware KB – Change the IP Address of a vRealize Operations Manager 6.x or later Single Node Deployment (2108696)

[VMware] Windows 1903/1909 run VMware Workstation / Workstation Pro error “VMware Workstation and Device/Credential Guard are not compatible. VMware Workstation can be run after disabling Device/Credential Guard"

近日當在用Windows 10 1903/1909 在跑VM時會跳出錯誤訊息"VMware Workstation and Device/Credential Guard are not compatible. VMware Workstation can be run after disabling Device/Credential Guard"。

那工法稍稍多了點….Orz
不是單單什麼開啟 Windows boot menu Hyper-V auto 或 Hyper-V off之類就可以解決。

<Resolution>

step01. Win + R

step02. cmd.exe

step03. gpedit.msc

step04.
Computer Configuration > Administrative Templates > System > Device Guard > Turn on Virtualization Based Security (Disabled)
電腦設定 > 系統管理範本 > 系統 > Device Guard > 開啟虛擬化安全性 (已停用)

step05.
cmd.exe

step06.
mountvol X: /s

copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y

bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d “DebugTool" /application osloader

bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path “\EFI\Microsoft\Boot\SecConfig.efi"

bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}

bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS

bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:

mountvol X: /d

step06.
bcdedit /set hypervisorlaunchtype off

(註)bcdedit /set hypervisorlaunchtype auto // 日後要用 Hyper-V 執行重開即可。


step07. 重開機記得要緊盯螢幕錯過以下動作還是無法啟動VMware Workstation 唷!!要按下WinKey或F3 才是真的達到關閉。
Virtualization Based Security Opt-out Tool
Do you want to disable Virtualization based security ?
Disabling this functionality changes the security configuration of Windows.
For the correct action in your oragization, contact your administrator before disabling.

** Press the Windows key or F3 to disabled protection . ESC to Skip this step. **


Reference :
0. “VMware Workstation and Device/Credential Guard are not compatible" error in VMware Workstation on Windows 10 host (2146361)
“Error 1402. Could not open key: UNKNOWN" while installing vCenter Server on Windows (1029282)
1. Dixin’s Blog – Run Hyper-V and VMware virtual machines on Windows 10
2. Leo Yeh’s Blog – 解決問題 Windows 10 (2)
3. 程式前沿 – 解決VM 與 Device/Credential Guard 不相容。在禁用 Device/Credential Guard 後,可以執行 VM 的方法
4. 小歐ou | 菜鳥自救會 – 設定開機選項選擇使用 VMWare 或 Hyper-V
5. ITREAD01 – VMware Workstation and Hyper-V are not compatible. 解決方案
6. 每日頭條 – VM與Device/Credential Guard解決方案

[VMware] Huananzhi X79-8D ESXi use RDM (Raw Device Mapping) mount local SATA NTFS file type

在用華南金牌 X79-8D 用 ESXi 有時會想拿舊硬碟資料存取,總是想到要用RDM,卻發現無法使用 RDM 方式。但仔細檢查明明在BIOS (boot time press Del )有啟用 Intel VT-d 卻還是不行?

找尋到有另一個方式也是可以達到RDM效果。

2019-12-20補充 : 根據原廠KB 1017530 描述到本地控制器大多不符合RDM硬體需求因此預設是禁用。所以和Intel VT-d 不相干。

Workaround :
step01. ssh ESXi

step02. # ls /dev/disksesxcfg-mpath -l ls -al /vmfs/devices/disks
找尋到像 " t10.ATA_____HD1000320AS_________________________________________XXXXXXXX " 字串 device-name

step03.建立一個RDM link
command : vmkfstools -r <source> (space) <destination>
e.g.
vmkfstools -r /vmfs/devices/disks/ t10.ATA_____HD1000320AS_________________________________________XXXXXXXX / vmfs/volumes/目標VM目錄 /RDM-disk.vmdk

vmkfstools -z /vmfs/devices/disks/ t10.ATA_____HD1000320AS_________________________________________XXXXXXXX “/vmfs/volumes/目標VM目錄/RDM-disk.vmdk" (因為要接近實體我推薦用 -z )

(註)
-r –createrdm /vmfs/devices/disks/…
-z –createrdmpassthru /vmfs/devices/disks/…

step03.編輯欲使用Local SATA VM,右鍵 “Edit Settings" > Add > HDD > Existing hard disk 找到剛建立連結 RDM-disk.vmdk

step04.打開VM console , then check disk manager , online disk .

Done.

Reference :
1. osiutino’s Blog – 在 ESXi 利用 RDM 直接掛載實體硬碟到 VM ( HP MicroServer N36L 適用)
2. www.vmwarearena – 2 Simple ways to Create Virtual Compatibility RDM Disks
3. 暉獲無度的步烙閣 – 在 ESXi 6.0 新增 USB 外接硬碟當 Datastore
4. homecomputerlab – VMware SATA disk Raw Device Mapping (RDM)
5. GitHub , Hengjie – How to passthrough SATA drives directly on VMWare EXSI 6.5 as RDMs
6. VMware KB – Raw Device Mapping for local storage (1017530)
7. vClouds – How to build a 64Gb Low Power and Fast ESXi Home Lab

[VMware] Huananzhi X79-8D install ESXi 6.7 U3 fail ?

即然有了洋垃圾伺服器裝個ESXi也不為過,興奮之際直接下載ESXi 6.7 U3 installer 使用了 Rufus create esxi usb boot 安裝發現載入一半會出現如下畫面

Error message :
Shutting down firmware services…
Page allocation error: Out of resources
Failed to shutdown the boot services.
unrecoverable error

Workaround:

雖然看來似乎 UEFI mode 造成,但試過改為 Legacy Mode似乎也一樣,
有論壇討論到幾個方式 > 更新 bios / 關閉 UEFI / legacy Only boot / disable VT-d (mandatory) ;但不符合我環境都無效。
那換個方式先裝舊版再升級總可以吧。X-)


Step01. use ESXi 6.7 U2 install (PS:華南金牌 X79 內建網卡是 Realtek 8168記得手動自製 image 唷 !)

Step02. // update patch ‘ ESXi670-201911001.zip / Build 15018017 / MD5 checksum 8d3ef79c9275bc97f9ce081b70e901c6 ‘
PS: 這問題在這更新檔才能得已解決, Please reference this

> esxcli network firewall ruleset set -e true -r httpClient

> esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep -i ESXi-6.7.0-2019

> esxcli software profile update -p ESXi-6.7.0-20191104001-standard -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot -index.xml

Step03. 更新後重開檢查版本是否為ESXi 6.7 U3 + 最新 Patch 
ESXi 6.7.0 , Build 13006603

Reference :
1. virtusolve.home.blog – ESXi Host cannot boot after upgrading to 6.7 U3- Page allocation error:Out of resources
2. GitHub – “Multiboot buffer is too small." after upgrade to ESXi-6.7.0-20181002001-standard (Build 10302608) #1

[VMware]Huananzhi X79-8D onboard NIC (Realtek 8168) custom ESXi 6.7x image

Pre-ready
Step01.
PS > Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Step02.
PS> Install-Module -Name VMware.PowerCLI

Step03.
Download " ESXi-Customizer-PS-v2.6.0.ps1 " , download link (至今是最新作者說是最後一版)

Step04.
Download Realtek 8168 for ESXi driver , download link
Reference : https://vibsdepot.v-front.de/wiki/index.php/Net55-r8168#Direct_Download_links

Step05.
Download VMware vSphere Hypervisor (ESXi) Offline Bundle (PS: not .ISO installer boot cd !)
e.g. I want to install ESXi 6.7 Update 2 , filename : update-from-esxi6.7-6.7_update02.zip

Step06.
PS> Set-ExecutionPolicy Unrestricted

Step07.
PS> .\ESXi-Customizer-PS-v2.6.0.ps1
(If you don’t care warning message ,if yes , please type as below command-lin >
PS> Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true

Step08.
PS> ./ESXi-Customizer-PS-v2.6.0.ps1 -izip update-from-esxi6.7-6.7_update03.zip -dpt net55-r8168-8.045a-napi-offline_bundle.zip -load net55-r8168

-------------------------------執行過程---------------------------------
PS D:\temp> ./ESXi-Customizer-PS-v2.6.0.ps1 -izip update-from-esxi6.7-6.7_update03.zip -dpt net55-r8168-8.045a-napi-offline_bundle.zip -load net55-r8168

安全性警告
只執行您信任的指令碼。來自網際網路的指令碼雖然可能很有用,但是這個指令碼有可能會傷害您的電腦。若信任此指令碼,請使用
Unblock-File Cmdlet 來允許執行指令碼,而不顯示此警告訊息。您要執行 D:\temp\ESXi-Customizer-PS-v2.6.0.ps1 嗎?
[D] 不要執行(D)  [R] 執行一次(R)  [S] 暫停(S)  [?] 說明 (預設值為 "D"): R

This is ESXi-Customizer-PS Version 2.6.0 (visit https://ESXi-Customizer-PS.v-front.de for more information!)
(Call with -help for instructions)

Logging to C:\Users\duke\AppData\Local\Temp\ESXi-Customizer-PS-3020.log ...

Running with PowerShell version 5.1 and VMware PowerCLI version 11.5.0.14899560

Adding base Offline bundle update-from-esxi6.7-6.7_update03.zip ... [OK]

Connecting additional depot net55-r8168-8.045a-napi-offline_bundle.zip ... [OK]

Getting Imageprofiles, please wait ... [OK]

Using Imageprofile ESXi-6.7.0-20190802001-standard ...
(dated 08/08/2019 09:57:28, AcceptanceLevel: PartnerSupported,
Updates ESXi 6.7 Image Profile-ESXi-6.7.0-20190802001-standard)

Load additional VIBs from Online depots ...
   Add VIB net55-r8168 8.045a-napi [New AcceptanceLevel: CommunitySupported] [OK, added]

Exporting the Imageprofile to 'D:\temp\ESXi-6.7.0-20190802001-standard-customized.iso'. Please be patient ...


All done.
-------------------------------   END  ---------------------------------

Reference:
1. networkguy – Installing Realtek Driver on ESXi 6.7
2. 流水上面的一塊葉 – Vmware ESXi 6.7 make your unsupported NIC work – 在不支援的Network card 上面可以進行安裝
3. S小魚仔S 使用 ESXi-Customizer-PS 封裝 Esxi 6.5 Realtek、ACHI 驅動程式
4. 可丁丹尼 @ 一路往前走2.0 – ESXi 新增Realtek網路驅動
5. VMware Front Experience – ESXi-Customizer-PS

[VMware] VM 安裝Windows Server 品牌隨機版(ROK;Reseller Optional Kit)

因底層是VMware 因此會造成虛擬機無法direct 上層 BIOS資訊導致會無法辨視是 Vendor ROK activate.

Resolution :

step01. modify vm.vmx

step02. add > SMBIOS.reflectHost ="True"

step03. vim-cmd vmsvc/reload {該機VMID}

Reference:
1. ESX Server 3.0.1, Patch ESX-1002095; Updates to VMware-esx-vmx and VMware-esx-tools; Support for OEM Windows SLP (1002095)
2. How to: VMWARE: pass mainboard BIOS to VM
3. 51CTO博客 – VMware vSphere ESXi 6.0 激活OEM Windows

[VMware] import .ova happen error “OVF Package with compressed disks is currently not supported for OVF import"

在匯入一個 ‘vsim-esx-DOT8.3.2-cm.ova’ 發生錯誤查一下需要用 ovftool.exe 來轉換一下才能用.

Resolution:

ovftool.exe 目標.ova 新檔.ova

**sample**
“c:\Program Files (x86)\VMware\VMware Workstation\OVFTool\ovftool.exe" d:\downloads\vsim-esx-DOT8.3.2-cm.ova d:\downloads\vsim-esx-DOT8.3.2-cm-new.ova