∮Ω奧米加空間∮»技術文件區»VMware ESXi 筆記
| 作者 |
主題 分頁:[ 1 2 ] |
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 1 篇) VMware ESXi 筆記
VMware ESXi 4.1 Update 1 更新
方式一 SSH 資料來源:來上電腦課!
開啟
下載 ESXi 4.1 Update 1 (upgrade ZIP from ESXi 4.1) 更新檔「update-from-esxi4.1-4.1_update01.zip」,使用「esxupdate」指令更新 ESXi Server。
【安裝前的準備】
執行 VMware vSphere Client 登入 ESXi Server,以「Datastore Browser」上傳檔案功能,傳送更新檔到主機 Datastore。
關閉所有 Virtual Machine,ESXi 系統進入「維護模式」:
VMware vSphere Client >Inventory >Host >Enter Maintenance Mode
VMware ESXi 4.1 Update 1 更新
Posted by admin on 24 二月, 2011 21:20
下載 ESXi 4.1 Update 1 (upgrade ZIP from ESXi 4.1) 更新檔「update-from-esxi4.1-4.1_update01.zip」,使用「esxupdate」指令更新 ESXi Server。
【安裝前的準備】
執行 VMware vSphere Client 登入 ESXi Server,以「Datastore Browser」上傳檔案功能,傳送更新檔到主機 Datastore。
關閉所有 Virtual Machine,ESXi 系統進入「維護模式」:
VMware vSphere Client >Inventory >Host >Enter Maintenance Mode
更新前以 SSH 連線方式登入主機,使用「vmware -l」、「vmware -v」和「esxupdate query」指令查詢記錄更新前的版本及更新狀態,以便更新後驗證對照。
~ # vmware -l
VMware ESXi 4.1.0 GA
~ # vmware -v
VMware ESXi 4.1.0 build-260247
~ # esxupdate query
Bulletin ID Installed Summary
【開始系統更新】
更新 VMware ESXi 的「esxupdate」指令用法為:
esxupdate --bundle 《更新檔路徑》 update
例如:
esxupdate --bundle /vmfs/volumes/datastore1/update-from-esxi4.1-4.1_update01.zip update
開始更新:
Unpacking deb_vmware-esx-tool.. ########### [100%]
Unpacking deb_vmware-esx-firm.. ########### [100%]
Unpacking cross_oem-vmware-es.. ########### [100%]
Unpacking cross_oem-vmware-es.. ########## [100%]
Removing packages :vmware-esx.. ########## [100%]
Installing packages :deb_vmwa.. ############ [100%]
Installing packages :cross_oe.. ############# [100%]
Installing packages :deb_vmwa.. ############ [100%]
Running [/usr/sbin/vmkmod-install.sh]...ok.
The update completed successfully, but the system needs
to be rebooted for the changes to be effective.
更新完成的畫面顯示需 reboot 才能完成更新作業,那就重新開機吧!
【登入主機恢復正常運作】
更新後首次執行 VMware vSphere Client,需「Run the installer」更新管理程式,才能登入 ESXi Server。
數分鐘後登入系統退出「維護模式」:
VMware vSphere Client >Inventory >Host >Exit Maintenance Mode
重新啟動所有 Virtual Machine。
成功!
方式二 VMware vSphere CLI 資料來源:若海客栈
先下载VMware vSphere CLI:
http://downloads.vmware.com/d/details/vcli41/ZHcqYmRoaCpiZHRAag==#version_history
看清楚版本号,必须要下载4.1的版本,不然你会有This operation is NOT supported on 4.1.0 platform.的提示
在下载更新包
https://www.vmware.com/tryvmware/p/activate.php?p=free-esxi&lp=1
下载这个ESXi 4.1 Update 1 (upgrade ZIP from ESXi 4.1)
当然如果你的ESXi不是4.1的就下载相对应的版本,升级方法一样(本人没试过,理论上一样)
别忘记了把VMware vSphere Client也下下来
详细升级过程:
一、用VMware vSphere Client关闭所有虚拟主机,并进入维护模式(选择你的Esxi -> 右键“进入维护模式”)
二、运行vSphere CLI,步骤如下:开始->程序->VMware->VMware vSphere CLI ->Command Prompt
三、输入以下命令:
1) cd bin
2) vihostupdate.pl -i –server 服务器名或IP -b 更新文件存放的完整路径
Enter username: root
Enter password: 密码
Please wait patch installation is in progress …
3) 静静等待,在VMware vSphere Client下面日志栏能看到进度,在57%的时候会停顿很久然后就是完成了
The update completed successfully, but the system needs to be rebooted for the changes to be effective.看到这个就说明已经完成了,然后重启ESXi就是新版本了。
方式三 VMware vSphere CLI + config.txt 資料來源:00086網誌
首先定義一份 config.txt 的檔案, 此處假設是 d:\config.txt 內容如下:
==========================
VI_SERVER = 伺服器IP
VI_USERNAME = root
VI_PASSWORD = 密碼
VI_PROTOCOL = https
VI_PORTNUMBER = 443
==========================
vihostupdate –config d:\config.txt –install –bundle d:\update-from-esx4.1-4.1_update01.zip
本帖由dc最後編輯於2012-10-28 10:07
Your mind to my mind,
your thought to my thought |
| 發表時間:2011-03-22 20:21 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 2 篇)
如果需要 實體機轉成虛擬機的話 P2V
可以使用 VMware vSphere Client 來不關機轉換,但是需要有一台 ESXi 來轉入才行。
Linux 的機器必須指定區網 IP 轉換才不會失敗
在使用 VMware vCenter Converter 轉換 Linux -> ESXi 開機時會出現
error loading operating system.
主要是 GRUB 錯誤的關係,請放入 Linux 光碟
出現 boot: 時輸入
linux secure
依照預設值即可,回到命令視窗後
chroot /mnt/sysimage
grub-install /dev/sda1
重開機即可正常開機,不過此時網路卡啟動會失敗。
本帖由dc最後編輯於2012-04-11 15:30
Your mind to my mind,
your thought to my thought |
| 發表時間:2012-04-11 09:50 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 3 篇) 【原創】Esxi5.0 Updata1 升級 Esxi5.1
將 VMware-ESXi-5.1.0-799733-depot.zip 上傳到 Host 上
Esxi SSH 預設未開啓
請到 Configuration -> Software 頁籤 -> Security Profile -> Services -> Properties… -> Lable 選 SSH -> Options… -> Service Commands -> Start -> OK
SSH 登入使用帳號密碼無效要選擇 Keyboard Interactive -> OK -> 輸入密碼 -> OK
輸入指令看版本
esxcli software profile get
ESXi-5.0.0-20120302001-standard
Name: ESXi-5.0.0-20120302001-standard
更新 VMware ESXi 5.0 前先讓 ESXi Server 進入「維護模式」:
要把 guest 關閉才能下不然會失敗
錯誤訊息
~ # vim-cmd hostsvc/maintenance_mode_enter
Enter maintenance mode mode failed
'vim.Task:haTask-ha-host-vim.HostSystem.enterMaintenanceMode-215137166'
關閉後在下成功
~ # vim-cmd hostsvc/maintenance_mode_enter
'vim.Task:haTask-ha-host-vim.HostSystem.enterMaintenanceMode-215137406'
更新指令
~ # esxcli software vib install -d /vmfs/volumes/datastore1/VMware-ESXi-5.1.0-799733-depot.zip
更新完畢後退出維護模式
vim-cmd hostsvc/maintenance_mode_exit
重開機
reboot
記得要更新這個版本才連得上
VMware-viclient-all-5.1.0-786111.exe
再看一次版號
esxcli software profile get
(Updated) ESXi-5.0.0-20120302001-standard
Name: (Updated) ESXi-5.0.0-20120302001-standard
Vendor: localhost.mshome.net
Creation Time: 2012-10-28T01:17:03
Modification Time: 2012-10-28T01:49:21
Stateless Ready: True
Description:
2012-10-28T01:17:03.450567+00:00: The following VIBs are
installed:
scsi-bnx2i 1.9.1d.v50.1-5vmw.510.0.0.799733
sata-sata-promise 2.12-3vmw.510.0.0.799733
ipmi-ipmi-devintf 39.1-4vmw.510.0.0.799733
esx-xserver 5.1.0-0.0.799733
有最後面那一行就是更新成功了~
用這個指令也能看版號比較直覺
~ # vmware -l
VMware ESXi 5.1.0 GA
~ # vmware -v
VMware ESXi 5.1.0 build-799733
本帖由dc最後編輯於2012-10-28 12:46
Your mind to my mind,
your thought to my thought |
| 發表時間:2012-10-28 10:11 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 4 篇) 【推薦】關於 Esxi 虛擬機備份
目前免費也最方便達到自動備份的程式就屬 ghettoVCB 了
官方網站
https://github.com/lamw/ghettoVCB
相關的介紹文章很多~我就從實際作業上來說明了~
我是使用 Esxi5.1.0 update01 1065491 版本
首先是 ghettoVCB.sh 這個檔案的文字格式為 Unix/Linux/Mac OS X (LF)
如果存成 Windows (CR+LF) 在執行的時候會出現錯誤,程式碼沒錯但是錯在換行格式上~要記得~
log 輸出的目錄要改這個
| 代碼: |
LOG_OUTPUT="/tmp/ghettoVCB-$(date +%F_%H-%M-%S)-$$.log"
改成你要放 log 的路徑
LOG_OUTPUT="/vmfs/volumes/datastore1/log/ghettoVCB-$(date +%F_%H-%M-%S)-$$.log"
|
執行時的路徑也可以修改
| 代碼: | WORKDIR=${WORKDIR:-"/tmp/ghettoVCB.work"}
改成你要執行時的路徑,執行完畢後檔案會自己刪除
WORKDIR=${WORKDIR:-"/vmfs/volumes/datastore1/log/ghettoVCB.work"}
|
建議不要修改 ghettoVCB.sh 的設定值來備份,因為這樣維護不易。使用設定檔 ghettoVCB.conf 來維護比較靈活
ghettoVCB.conf 格式如下,文字格式為 Unix/Linux/Mac OS X (LF)
中文的部分為說明不用複製
| 代碼: | VM_BACKUP_VOLUME=/vmfs/volumes/nfs
#esxi 實際存取路徑,也就是 ssh 進 esxi 主機時 /vmfs/volumes 底下的路徑
DISK_BACKUP_FORMAT=thin
#定義備份的硬碟格式
# zeroedthick (Thick Provision Lazy Zeroed) 有使用才初始化
# 2gbsparse特殊格式分割成2GB
# thin(Thin Provision)隨使用量增加
# eagerzeroedthick(Thick Provision Eager Zeroed) 預先初始化
VM_BACKUP_ROTATION_COUNT=1
#定義備份保留的數量預設值為3
POWER_VM_DOWN_BEFORE_BACKUP=0
# 虛擬機POWER OFF時不會要求snapshotting(enable=1,disable=0)
ENABLE_HARD_POWER_OFF=0
# 定義沒有安裝VMware Tools的虛擬機是否可以在硬碟POWER OFF時啟用"POWER_VM_DOWN_BEFORE_BACKUP"
ITER_TO_WAIT_SHUTDOWN=3
# 如果啟用"ENABLE_HARD_POWER_OFF"此定義執行強制關閉時會倒數運算,單位3為3分鐘180秒
POWER_DOWN_TIMEOUT=5
# 設定POWER DOWN的時間。等待關閉時VM會放棄或忽略特定的VM備份。單位5為5分鐘300秒
ENABLE_COMPRESSION=0
# 備份是否啟用壓縮 (enable=1,disable=0)
VM_SNAPSHOT_MEMORY=0
# 是否啟用 VM 虛擬機的快照記憶體 (enable=1,disable=0)
VM_SNAPSHOT_QUIESCE=0
# 是否啟用對停止的 VM 虛擬機使用快照 (需有安裝 VMware Tools)
ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0
# 允許虛擬機快照進行備份,這將鞏固現有的快照!
ENABLE_NON_PERSISTENT_NFS=1
#定義非持久性的NFS備份 (enable=1,disable=0)
UNMOUNT_NFS=0
# 是否要卸載NFS(yes=1,no=0)
NFS_SERVER=192.168.1.1
#NFS 的IP位置
NFS_MOUNT=/volume1/vm_host
#掛載 NFS 的路徑
NFS_LOCAL_NAME=nfs
#在 esxi 上掛載使用的名稱,要與第一個設定值的名稱相輔
NFS_VM_BACKUP_DIR=/
#備份的路徑 如果你的虛擬機名稱為 test 設定值為 / 時 備份路徑會是 /volume1/vm_host/test/test-日期
SNAPSHOT_TIMEOUT=15
# 設定等待VM快照的時間,在等待關閉時會放棄和忽略特定備份的VM
EMAIL_LOG=0
# 是否發送debug的LOG,這是做為測試使用
EMAIL_SERVER=auroa.primp-industries.com
# Email 的SMTP server
EMAIL_SERVER_PORT=25
#mail port
EMAIL_DELAY_INTERVAL=1
# 設定每封mail之間發送的延遲時間。
[email protected]
#收件者
EMAIL_FROM=root@ghettoVCB
#發信者
WORKDIR_DEBUG=0
#是否移除作業時的檔案路徑?1=yes, 0=no
VM_SHUTDOWN_ORDER=
# 逗號分隔的虛擬機關機順序
VM_STARTUP_ORDER=
# 逗號分隔的虛擬機開機順序
|
附件 g.sh 是我實際實用過搭配 ghettoVCB.conf 的 sh
上傳後記得要先
chmod 755 g.sh
然後先測試一遍
./g.sh -a -g ghettoVCB.conf -d dryrun
確認都沒問題後才
./g.sh -a -g ghettoVCB.conf
正式使用
-a 是備份全部的虛擬機
-f vm_list 是依照 vm_list 清單備份
當備份時出現
ERROR: failed to locate and extract VM_ID for
代表你的虛擬機名稱有 + 字元所以無法備份,將他改個名稱就能正常備份了
如果你在備份的時候 Ctrl+C 停止的話會造成快照建立到一半,下次在建立時會失敗的問題。
這時候需要按右鍵 -> Snapsoft -> Snapshot Manager... 刪除快照
之後再執行備份就可以了~
本帖所帶附件:g.sh (61.81K) 本附件被下載次數: 3
本帖由dc最後編輯於2013-11-01 11:49
Your mind to my mind,
your thought to my thought |
| 發表時間:2013-09-23 17:12 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 5 篇) 【教學】VMware-viclient-all-5.5.0
關於在 WinXp 與 Win2003 安裝 VMware-viclient-all-5.5.0-1281650-5.5.exe 會無法使用的主要原因可以看這裡
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2031053
Search fails and Hardware Health and Health Status plug-ins are disabled in the vSphere Client (2031053)
Details
The vSphere Client does not connect to the Inventory service when installed on Windows Server 2003 or Windows XP, and has these symptoms:
When you try to search the vSphere Client inventory, you see the error message:
Login to the query service failed. A communication error occurred while sending data to the server. (The underlying connection was closed: An unexpected error occurred on a send.)
While trying to sort by name at the cluster level, you see the error:
Error when trying to sort : Login to query service failed: The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream
Hardware Health and Health Status plug-ins are disabled and cannot be viewed in the vSphere Client.
In the performance overview page, you see the error:
This program cannot display the webpage
Solution
This issue occurs due to increased security of the cipher strengths which are, by default, used by the VMware Management Web Services components. Due to this change that was introduced in vSphere 5.1, the host operating system is required to support a higher cipher strength to be able to connect to these components.
In Windows Vista and Windows Server 2008, the proper cipher strengths are built into the operating system. However, for older Windows operating systems, a Microsoft hotfix must be applied to add the supported cipher strengths.
For more information on the cipher strengths that get added with the hotfix, see the Microsoft Knowledge Base article 948963.
Note: The preceding link was correct as of November 30, 2012. If you find a link is broken, provide feedback and a VMware employee will update the link.
Resolution
Windows 2003 (32-bit and 64-bit Edition)
For Windows Server 2003 (32-bit and 64-bit), apply the appropriate hotfix to the machine on which the vSphere Client is installed.
Note: If the vSphere Client is installed on the Windows Server where vCenter Server is installed, you must also apply the patch to that Windows Server.
To download the hotfix for your system, see the Microsoft Knowledge Base article 948963.
Notes:
You must reboot the machine after applying the hotfix.
Non-English versions of the hotfixes are also available on the Microsoft site. Click the Show hotfixes for all platforms and languages link on the Hotfix Request page to view the available versions.
Windows XP (32-bit)
There is no hotfix available for Windows XP (32-bit). Microsoft currently only provides limited support for Windows XP, and as a result the hotfix has not been released for it. To resolve this issue, you must upgrade your host operating system to Windows Vista or later, which support the use of high cipher strengths.
If you are unable to upgrade your environment, you may try adding less secure cipher strengths back to the configuration, which allows communication to proceed successfully.
To add less secure cipher strengths back to the configuration:
Caution: This is not a recommended configuration and is provided for backward compatibility purposes only. This is not extensively tested and is supported on a best effort basis only.
Log in as an administrator to the server where vCenter Server 5.1 is installed.
Navigate to the tomcat configuration directory.
Note: By default, this directory is located at C:\Program Files\VMware\Infrastructureomcat\conf\. In vCenter Server Appliance, the file is located at /ur/lib.vmware-vpx/tomcat/conf.
Open the server.xml file using a text editor.
Change the Connector text to add support for weaker ciphers by changing it from:
<Connector SSLEnabled="true" acceptCount="100" ciphers="TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DH_RSA_WITH_AES_256_CBC_SHA, TLS_DH_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DH_RSA_WITH_AES_128_CBC_SHA, TLS_DH_DSS_WITH_AES_128_CBC_SHA" connectionTimeout="20000" executor="tomcatThreadPool" keystoreFile="${bio-vmssl.keyFile.name}" keystorePass="${bio-vmssl.SSL.password}" keystoreType="PKCS12" maxKeepAliveRequests="15" port="${bio-vmssl.https.port}" protocol="HTTP/1.1" redirectPort="${bio-vmssl.https.port}" scheme="https" secure="true"></Connector>
To:
<Connector SSLEnabled="true" acceptCount="100" ciphers="TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DH_RSA_WITH_AES_256_CBC_SHA, TLS_DH_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_DH_RSA_WITH_AES_128_CBC_SHA, TLS_DH_DSS_WITH_AES_128_CBC_SHA ,SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" connectionTimeout="20000" executor="tomcatThreadPool" keystoreFile="${bio-vmssl.keyFile.name}" keystorePass="${bio-vmssl.SSL.password}" keystoreType="PKCS12" maxKeepAliveRequests="15" port="${bio-vmssl.https.port}" protocol="HTTP/1.1" redirectPort="${bio-vmssl.https.port}" scheme="https" secure="true"></Connector>
Note: Add only the red text as indicated and do not change any other options. This adds back support for less secure cipher strengths for backward compatibility purposes.
Restart the VMware VirtualCenter Management Web Services service. For more information, see Stopping, starting, or restarting vCenter services (1003895).
大意是說密碼套件不符合的原因所以才無法連線要安裝 HotFixes 才能使用
Win2003 點這個連結給微軟信箱他會把連結寄給你
http://support.microsoft.com/kb/948963
KB 文章編號:948963
語言:Chinese (Traditional)
平台:i386
地點:(http://hotfixv4.microsoft.com/Windows%20Server%202003/sp3/Fix192447/3790/free/351395_CHT_i386_zip.exe)
-----------------------------------------------------------
KB 文章編號:948963
語言:Chinese (Traditional)
平台:x64
地點:(http://hotfixv4.microsoft.com/Windows%20Server%202003/sp3/Fix192447/3790/free/351410_CHT_x64_zip.exe)
Winxp 的話改 cfg 檔 並照這個文件內容重啟程式
http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1003895
本帖由dc最後編輯於2013-10-31 11:54
Your mind to my mind,
your thought to my thought |
| 發表時間:2013-10-31 11:51 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 6 篇)
開啟 snmp 服務
登入到 esxi ssh
esxcli system snmp set --enable true
esxcli system snmp set --communities public
vSphere Client 配置
服務要使用啟動snmp
防火牆要設定只使用的IP
開啟 syslog 寫入到遠端主機
esxcli system syslog config get
esxcli system syslog config set --loghost='udp://收集的主機IP:514'
esxcli system syslog reload
esxcli network firewall ruleset set --ruleset-id=syslog --enabled=true
esxcli network firewall refresh
Your mind to my mind,
your thought to my thought |
| 發表時間:2014-01-20 17:26 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 7 篇) 【教學】如何讓 esxi 裡的透通式防火牆生效
資料來源:網卡模式
網卡模式為以下四種:
Unicast、Broadcast、Multicast、Promiscuous。
unicast是指網卡在工作時接收目的地址是本機硬體位址的資料幀。
Broadcast是指接收所有類型為廣播報文的資料幀。
Multicast是指接收特定的組播報文。
Promiscuous則是通常說的混雜模式,是指對報文中的目的硬體位址不加任何檢查,全部接收的工作模式。
資料來源:megacrack , 不自量力
主要在 vSwitch 上設定開啟混亂模式
Security
Promiscuous Mode: 是否啟用網卡混亂模式,也就是開啟網卡監聽功能
MAC Address Changes: 是否允許 VM 能更改 MAC Address
Forged Transmits: 是否啟用阻擋 VM 所送出的封句 (通常配合 Application 進行設定)

本帖由dc最後編輯於2014-07-16 18:05
Your mind to my mind,
your thought to my thought |
| 發表時間:2014-07-16 17:47 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 8 篇)
本地硬碟做RDM直接使用磁碟
掛載實體硬碟
首先 ssh 到 esxi 主機
~ # fdisk -l
***
*** The fdisk command is deprecated: fdisk does not handle GPT partitions. Please use partedUtil
***
Disk /dev/disks/naa.6c81f660f45937001bd9044a07056f67: 599.5 GB, 599550590976 bytes
255 heads, 63 sectors/track, 72891 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/disks/naa.6c81f660f45937001bd9044a07056f67 doesn't contain a valid partition table
fdisk: device has more than 2^32 sectors, can't use all of them
Found valid GPT with protective MBR; using GPT
Disk /dev/disks/naa.6c81f660f45937001b08a35906224be8: 4294967295 sectors, 4095M
Logical sector size: 512
Disk identifier (GUID): 7d274159-3687-404a-bda0-3b59f620fa1a
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 4683988958
Number Start (sector) End (sector) Size Code Name
1 64 8191 8128 0700
2 7086080 15472639 8190K 0700
3 15472640 4683988958 4452M 0700
5 8224 520191 499K 0700
6 520224 1032191 499K 0700
7 1032224 1257471 219K 0700
8 1257504 1843199 571K 0700
9 1843200 7086079 5120K 0700
~ #
或是
~ # cd /dev/disks
/dev/disks # ls
也可以看到相關資訊~但是本例使用 fdisk -l 比較合適
圖形介面
Configuration -> View: Datastores -> Add Storage... -> Disk/LUN -> Next -> 選擇硬碟後 -> Next
可以看到 File System Version 的畫面如下

但這是新增 Storage 不是直接調用實體硬碟~
所以我們回到 SSH
使用實體硬碟時必需要建立與實體硬碟溝通的方式,所以使用工具建立一個.vmdk中介檔,它與虛擬硬碟提供的.vmdk是一樣,但它只是個中介檔,命令如下:
vmkfstools –z [硬碟掛載路徑] [產生連結的vmdk檔案]
vmkfstools -z /vmfs/devices/disks/<硬碟 ID> /vmfs/volumes/<DataStore 名稱>/<RDM 虛擬硬碟名稱>.vmdk
vmkfstools -z /vmfs/devices/disks/naa.6c81f660f45937001bd9044a07056f67 /vmfs/volumes/datastore1/db600gbhdd.vmdk
之後就會產生出 db600gbhdd.vmdk 檔案,接下來到目錄確認檔案情況
cd /vmfs/volumes/datastore1
ls -l 可以看到產生了這兩個檔案
-rw------- 1 root root 599550590976 Oct 30 04:03 db600gbhdd-rdmp.vmdk
-rw------- 1 root root 501 Oct 30 04:03 db600gbhdd.vmdk
而 db600gbhdd-rdmp.vmdk 就是實體硬碟的大小
如果使用到不正確的路徑路如 /dev/disks/
vmkfstools -z /dev/disks/naa.6c81f660f45937001bd9044a07056f67 /vmfs/volumes/datastore1/db600gbhdd.vmdk
錯誤訊息
Failed to create virtual disk: The specified device is not a valid physical disk device (20).
接下來建立虛擬機在 Select a Disk 時選擇 Use an existing virtual disk -> Next -> 選擇建立好的 [datastore1] db600gbhdd.vmdk
在 Advanced Options 時 Mode 勾選 Independent (獨立) 選擇 Persistent (持久)

之後就繼續建立吧^^
資料來源
http://cms.35g.tw/coding/esxi-vm-%E4%BD%BF%E7%94%A8%E5%AF%A6%E9%AB%94%E7%A1%AC%E7%A2%9F/
http://bbs.fyjy.net/showthread.php?t=4817&langid=3
http://ntcn.net/blog/wp-content/uploads/2013/11/VMware_ESXi_5.0_%E4%BD%BF%E7%94%A8%E6%9C%AC%E5%9C%B0%E7%A3%81%E7%9B%98%E5%81%9ARDM_%E7%9B%B4%E6%8E%A5%E7%A3%81%E7%9B%98%E8%AE%BF%E9%97%AE.pdf
本帖由dc最後編輯於2014-10-30 12:44
Your mind to my mind,
your thought to my thought |
| 發表時間:2014-10-30 11:58 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 9 篇)
資料來源:静一
在 Esxi 底下無法在安裝 Hyper-v 來虛擬使用~找了一些網站改 vmx 檔都無效
最終修改 guestOS 才生效環境為 esxi 5.5.0 1331820
虛擬機建立完畢之後關機,修改虛擬機的 .vmx 檔案
找到 guestOS = "windows8srv-64" 此值根據你安装的系统不同而不同。
2012 如上顯示,2008R2 顯示的是 windows7srv-64。
將名稱修改為 winhyperv ,然後儲存在開啟虛擬機。
就能安裝 Hyper-v 角色囉~
Your mind to my mind,
your thought to my thought |
| 發表時間:2014-11-12 10:16 |
|
dc
管理員

性別:男
來自:瓦肯星
發表總數:11722
註冊時間:2002-05-07 16:32 |
(第 10 篇)
當在連線 esxi 主機時出現下列的錯誤訊息
vsphere client could not connect to "server ip"
An unknown connection error occurred. (The client could not send a complete request to the server. (基礎連線已關閉:傳送時發生未預期的錯誤))
處理方式有兩種
一.臨機處理
[F2] 進入管理介面->輸入帳號密碼->Troubleshooting Options->Restart Management Agents->[F11] 確定重啟
二.遠端處理
登入 ssh 並在 console 介面下指令
/etc/init.d/hostd restart
/etc/init.d/vpxa restart
如果是 ESXi 4.x
service vmware-vpxa restart
或者重啟所有的服務
esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0
services.sh restart
開啟 esxi 的 ssh 記得限定 ip 才可以連線,不然很危險的@@
官方文件請參考
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003490
Your mind to my mind,
your thought to my thought |
| 發表時間:2014-12-25 10:31 |
|
|
所有時間均為GMT+8, 現在是2026-06-10 11:01 分頁:[ 1 2 ] |
|