星期六, 12月 22, 2018

方便的 my.vmware.com 下載工具 - vmw-cli 測試小記

方便的 my.vmware.com 下載工具 - vmw-cli 測試小記

OS: openSUSE Leap 15 in Azure

之前看到一個工具 vmw-cli 可以用 command line 方式下載 VMware 產品 ISO
  • vmw-cli is a CLI client used to login and interact with my.vmware.com. It provides an interface for programmatic query and download of VMware product binaries.

今天有點時間, 來嘗試一下

# zypper  install  npm8
Building repository 'openSUSE-Leap-15.0-Non-Oss' cache ...................[done]
Building repository 'openSUSE-Leap-15.0-Oss' cache .......................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 4 NEW packages are going to be installed:
 nodejs-common nodejs8 nodejs8-devel npm8

The following recommended package was automatically selected:
 npm8

4 new packages to install.
Overall download size: 8.7 MiB. Already cached: 0 B. After the operation,
additional 34.7 MiB will be used.
Continue? [y/n/...? shows all options] (y): Y


使用 npm 安裝 vmw-cli

# npm  install  vmw-cli  --global

/usr/local/bin/vmw-cli -> /usr/local/lib/node_modules/vmw-cli/lib/vmw-cli.js
+ vmw-cli@1.1.13
added 82 packages in 8.946s

還沒有定義帳號密碼前先觀察資訊, 使用 vmw-cli  list 可以列出產品

# vmw-cli  list
vmware-workstation-pro
vmware-workstation-player
vmware-workspace
vmware-workspace-one
vmware-vsphere
vmware-vsphere-with-operations-management
vmware-vsphere-storage-appliance
vmware-vsphere-integrated-containers
vmware-vsphere-hypervisor-esxi
vmware-vsphere-data-protection-advanced
vmware-vsan
...


但是要進行其他相關指令會被提示要有帳號以及密碼

# vmw-cli   index vmware-vsphere

Updating [fileIndex.json] for all permitted downloads in [vmware-vsphere] ...
[ERROR]: environment variables $VMWUSER and $VMWPASS not set! Please configure

接下來嘗試 export 帳密
#export  VMWUSER='<userid>'
#export  VMWPASS='<password>'

嘗試 inex 但是這個過程會很久, 然後會產生 fileIndex.json
# vmw-cli  index vmware-vsphere

觀察相關資訊

# ls  /usr/local/lib/node_modules/vmw-cli/lib
cookies.json  extract-files.js  get-file.js get-product.js   group.vmware-vsphere.json index.json.session  utils.js vmw-cli.js xtable.js
examples      fileIndex.json    get-index.js  get-solution.js  index.json          mainIndex.json vmw-api.js  xcell.js

接下來嘗試 vmw-cli  find 指令
這邊是找出檔案名稱內有 vcsa 字元的

# vmw-cli   find  fileName:vcsa

Loading available solutions in [fileIndex.json] ...

solution                                   productGroup productType version fileName                                                      fileDate fileSize fileType download  
-----------------------------------------  ------------ ---------------- --------- ------------------------------------------------------------  ---------- -------- -------- --------
vmware-workspace-one                       VC67U1 Product Binaries  6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
vmware-workspace-one                       VC60U2M Product Binaries  6.0U2M VMware-VCSA-all-6.0.0-4191361.iso                             2016-09-15 2.605 GB iso yes
vmware-vsphere                             VC67U1 Product Binaries 6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
vmware-vsphere                             VC65U2C Product Binaries 6.5.0 U2c VMware-VCSA-all-6.5.0-9451637.iso                             2018-08-14 3.27 GB iso yes
vmware-vsphere                             VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-vsphere                             VC60U3H Product Binaries 6.0 U3h VMware-VCSA-all-6.0.0-9451619.iso                             2018-08-14 3.09 GB iso yes
vmware-vsphere                             VC60U2M Product Binaries 6.0U2M VMware-VCSA-all-6.0.0-4191361.iso                             2016-09-15 2.605 GB iso yes
vmware-vsphere-with-operations-management  VC67U1        Product Binaries  6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
vmware-vsphere-with-operations-management  VC60U3H       Product Binaries  6.0 U3h VMware-VCSA-all-6.0.0-9451619.iso                             2018-08-14 3.09 GB iso yes
vmware-vsphere-with-operations-management  VC60U2M       Product Binaries  6.0U2M VMware-VCSA-all-6.0.0-4191361.iso                             2016-09-15 2.605 GB iso yes
vmware-vsphere-with-operations-management  VC65U2C       Product Binaries  6.5.0 U2c VMware-VCSA-all-6.5.0-9451637.iso                             2018-08-14 3.27 GB iso yes
vmware-vsphere-with-operations-management  VC65U1G_OSS   Open Source    6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-vsan                                VC67U1 Product Binaries 6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
vmware-vsan                                VC65U2C Product Binaries 6.5.0 U2c VMware-VCSA-all-6.5.0-9451637.iso                             2018-08-14 3.27 GB iso yes
vmware-vsan                                VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-vsan                                VC60U3H Product Binaries 6.0 U3h VMware-VCSA-all-6.0.0-9451619.iso                             2018-08-14 3.09 GB iso yes
vmware-vsan                                VC60U2M Product Binaries 6.0U2M VMware-VCSA-all-6.0.0-4191361.iso                             2016-09-15 2.605 GB iso yes
vmware-vcloud-suite                        VC67U1        Product Binaries  6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
vmware-vcloud-suite                        VC60U2M Product Binaries  6.0U2M VMware-VCSA-all-6.0.0-4191361.iso                             2016-09-15 2.605 GB iso yes
vmware-vcloud-nfv                          VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-horizon                             VC67U1        Product Binaries  6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
vmware-horizon                             VC60U2M Product Binaries  6.0U2M VMware-VCSA-all-6.0.0-4191361.iso                             2016-09-15 2.605 GB iso yes
vmware-horizon                             VC65U1G_OSS Open Source   6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-horizon-apps                        VC67U1 Product Binaries 6.7.0U1 VMware-VCSA-all-6.7.0-10244745.iso                            2018-10-16 3.95 GB iso yes
[ 24/25310 ] entries - filter [ fileName:vcsa ]

從 fileIndex.json 內找出 24 筆
從上面的的輸出可以看到有不同的產品(solution), 不同檔案類型(fileType) 的產品

所以再加上過濾條件
# vmw-cli  find  fileName:vcsa,fileType:txt

Loading available solutions in [fileIndex.json] ...
solution                                   productGroup productType version fileName                                                      fileDate fileSize fileType download
-----------------------------------------  ------------ ----------- -------- ------------------------------------------------------------  ---------- -------- -------- --------
vmware-vsphere                             VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20  4.59 MB txt       yes
vmware-vsphere-with-operations-management  VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-vsan                                VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-vcloud-nfv                          VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
vmware-horizon                             VC65U1G_OSS Open Source 6.5.0U1g open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt  2018-03-20 4.59 MB txt yes
[ 5/25310 ] entries - filter [ fileName:vcsa,fileType:txt ]


嘗試下載檔案, 因為是 Lab, 所以下載 .txt 檔案測試, 檔案名稱由上面的 find 取得

# vmw-cli  get  open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt

Loading available solutions in [fileIndex.json] ...
Session file[/usr/local/lib/node_modules/vmw-cli/lib/index.json] [922] older than [600] seconds...
Synching delicious cookies from [https://my.vmware.com]
Offering up afforementioned snacks as a sacrifice to [https://my.vmware.com/oam/server/auth_cred_submit]
Pulling landing index.json [https://my.vmware.com/group/vmware/downloads]
{
"name": "Open Source License file for vCenter 6.5.0U1g",
"fileName": "open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt",
"fileDate": "2018-03-20",
"fileSize": "4.59 MB",
"fileType": "txt",
"md5sum": "06a3fab64c7a8ae2f962cf0b1576e95a",
"sha1sum": "229ad762dc69314c8c9bbefa2133b35cf1c2a800",
"sha256sum": "f38b53198fdc99bc2fed1b5d5b56c0967246103bd26af04c98c96abd97119e90",
"download": {
"downloadGroupCode": "VC65U1G_OSS",
"downloadFileId": "06a3fab64c7a8ae2f962cf0b1576e95a",
"vmware": "downloadBinary",
"baseStr": "",
"hashKey": "",
"tagId": "",
"productId": "",
"uuId": "53a9a37c-a7d3-47fc-aec8-c37834bcfe20"
}
}
[open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt] downloading... [=================================================>] 100% 0.0s 2789 KB/s 04.81/04.81 MB
MD5 MATCH: local[ 06a3fab64c7a8ae2f962cf0b1576e95a ] remote [ 06a3fab64c7a8ae2f962cf0b1576e95a ]


觀察相關資訊

# ls

.bash_history  .config .gnupg  .npm .viminfo bin  open-source-license-VMware-vCenter-Server-VCSA-65U1-g-GA.txt

下載完成
vmw-cli 也有容器化的版本, 因為大同小異, 所以就沒有再次測試

也算是多一個方便下載 my.vmware.com的工具吧



~ enjoy it

Reference:



CrazyDiskInfo with openSUSE Leap 15

CrazyDiskInfo with openSUSE Leap 15


OS: openSUSE Leap 15 in Azure


昨天在橋本修太的 Twitter 看到 Haruka 一篇文章 【小ネタ】openSUSEで CrazyDiskInfo をインストールしてディスクの健康状態を監視  , 所以就順手做了起來

套件名稱 CrazyDiskInfo


查了 software.opensuse.org/search


我使用的方式是 One click install 方式來安裝


安裝 OneClickInstallCLI 套件 yast2-metapackage-handler


# zypper  install   yast2-metapackage-handler


Loading repository data...
Reading installed packages...
Resolving package dependencies...


The following 12 NEW packages are going to be installed:
 expat perl-CPAN-Changes perl-Devel-Symdump perl-Net-DBus perl-Pod-Coverage perl-Test-Pod perl-Test-Pod-Coverage
 perl-X11-Protocol perl-XML-Twig perl-XML-XPath xdg-utils yast2-metapackage-handler


12 new packages to install.
Overall download size: 933.4 KiB. Already cached: 0 B. After the operation, additional 2.9 MiB will be used.
Continue? [y/n/...? shows all options] (y):


使用 OneClickInstallCLI 指令來安裝




If you continue, the following repositories will be subscribed:
* http://download.opensuse.org/repositories/home:/tsuroot/openSUSE_Leap_15.0/
If you continue, the following software packages will be installed:
* crazydiskinfo
Continue? y/N
Y (這邊輸入Y 繼續)
Adding Repositories...


這樣就完成安裝了


# crazy
No S.M.A.R.T readable devices.
If you are non-root user, please use sudo or become root.


傻眼..... Azure 上面的磁碟沒有 SMART readable device Orz….
真是 make me crazy XD


好吧, 只有拿自己的桌機繼續實驗了


OS:  openSUSE Leap 15


安裝相關套件


If you continue, the following repositories will be subscribed:
* http://download.opensuse.org/repositories/home:/tsuroot/openSUSE_Leap_15.0/
If you continue, the following software packages will be installed:
* crazydiskinfo
Continue? y/N
Y (這邊輸入Y 繼續)
Adding Repositories...


執行 crazy 指令, 輸出結果如下圖


# crazy




Reference:

~ enjoy it

星期三, 11月 28, 2018

Acronis Backup with iSCSI 小記

Acronis Backup with iSCSI 小記

Software: Acronis Backup 12.5 Build 10330 ( All in one / CentOS 7 )
iSCSI Server:  Dell EqualLogic PS6210

最近在測試 VMware 的 backup 方案, 因為預設的 VDP 最大備份的容量為 8TB, 所以就找了 Acronis 進行測試.

在測試 Acronis Backup 的時候, 第一個與 VDP 的差異就是 Acronis Backup 備份的位置
在沒有安裝 Agent 的狀況下
  • 就是必須要先有網路的資料夾( NFS, Samba, SFTP ) 這樣的空間,而不是直接備份到 Storage



VDP 的使用情境是 vSphere 會去掛載 Storage, 例如 iSCSI 然後 VDP 會備份到指定的 datastore.
但是上面沒有看到 iSCSI 的選項, 又不想因為要建立 NFS 這樣的 Share folder 然後去產生一個 VM 來服務, 於是有了一個想法
  • 讓 Acronis Backup 去掛載 iSCSI 磁區, 然後備份位置指向本機資料夾對應到 iSCSI
我使用的是 Acronis Backup all on one 版本 (OVF), 他是使用 CentOS 7 的作業統

# cat   /etc/*release
CentOS Linux release 7.4.1708 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"

所以現在要做的就是掛載 iSCSI 空間, 我事先在 Dell EqualLogic 建立 15TB 的 Volume
  • 因為是測試性質, 所以對於 iSCSI 只有使用 限制來源 IP 的方式, 沒有使用 CHAP 密碼驗證

參考網路上找到的資料

先安裝相關軟體

# yum  -y  install  iscsi-initiator-utils

觀察 iqn
# cat   /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:eab1a730877c

因為我沒有使用 CHAP, 所以就沒有去修改 /etc/iscsi/iscsid.conf

觀察 iSCSI Server
# iscsiadm -m discovery -t sendtargets -p  YOUR_IP
  • -m, --mode
  • -p, --portal
  • -t, --type

1XX.XXX.XXX.XXX:3260,1 iqn.XXXX-05.com.equallogic:8-XXXXX-d7b161ba6-4feb21cf4055bfe2-acronis-backup

觀察 iSCSI Server
# iscsiadm  -m  node  -o  show
  • -o, --op ( operator )

登入 iSCSI , 建立連線
# iscsiadm  -m  node  --login

觀察連線
# iscsiadm  -m  session  -o  show

tcp: [1] XXX.XXX.XXX.XXX:3260,1 XXXX-05.com.equallogic:8-XXXXX-d7b161ba6-4feb21cf4055bfe2-acronis-backup (non-flash)

觀察 partition
# cat  /proc/partitions

major minor  #blocks name

 11        0 2117824 sr0
  8     32 1048576 sdc
  8      0 41943040 sda
  8      1 1048576 sda1
  8      2 40893440 sda2
  8     16 1048576 sdb
253        0 36696064 dm-0
253        1 4194304 dm-1
  8     48 16106127360 sdd

#fdisk  -l

建立目錄
# mkdir   /backup

格式化 XFS
# mkfs.xfs  /dev/sdd

掛載目錄
#mount  /dev/sdd   /backup/

觀察 UUID
# blkid   /dev/sdd
/dev/sdd: UUID="7553f546-cbb3-4921-a114-da9c978adcae" TYPE="xfs"

修改 /etc/fstab, 讓開機的時候會進行 iSCSI 掛載

加入
UUID=7553f546-cbb3-4921-a114-da9c978adcae /backup xfs     defaults,_netdev        0 0

  • 這邊要注意 UUID= 後面的雙引號, 前後兩個符號記得拿掉
  • 記得加上 _netdev 選項


重新開機進行測試, 看看有沒有掛上 /backup

之後在 Acronis 備份的時候就可以指向 /backup 目錄了

~ enjoy it

Reference:

星期五, 11月 23, 2018

VMware esx.problem.hyperthreading.unmitigated 小記

VMware esx.problem.hyperthreading.unmitigated 小記

最近因為修正 VMware 的安全漏洞 ESXi 6.0 / 6.5 / 6.7 Out-of-Bounds Read Vulnerability (VMSA-2018-0026) (Remote Check)

上了最新的 Patch, 但是會出現 esx.problem.hyperthreading.unmitigated 警告


Google 一下資料, 參考 VMware KB https://kb.vmware.com/s/article/55806 以及其他人的作法, 就是在
Configure -- > Settings -- > Advanced System Settings 內
設定 VMkernel.Boot.hyperthreadingMitigationtrue , 並重新開機

相關的影響, 目前觀察中

先記下來

~ enjoy it

Reference