Thursday, 31 December 2020

Reset nextcloud database

 remove …/data, config/config.php and recreate the database before.


https://help.nextcloud.com/t/solved-how-to-reset-reinitialize-nextcloud-nc-17/63797

Friday, 25 December 2020

Nextcloud on TrueNas

 My reference:

https://www.samueldowling.com/2020/07/24/install-nextcloud-on-freenas-iocage-jail-with-hardened-security/

https://github.com/samuel-emrys-blogs/freebsd-nextcloud-setup-hardened


$ iocage create -n nextcloud -r 12.0-RELEASE ip4_addr="vnet0|192.168.0.54/24" defaultrouter="192.168.0.1" vnet="on" allow_raw_sockets="1" boot="on"


iocage start nextcloud

$ iocage exec nextcloud mkdir -p /mnt/data

$ iocage exec nextcloud mkdir -p /var/db/mysql

$ iocage exec nextcloud mkdir -p /usr/local/www/nextcloud/config

$ iocage exec nextcloud mkdir -p /usr/local/www/nextcloud/themes

$ iocage fstab -a nextcloud /mnt/tank/cloud /mnt/data nullfs rw 0 0

$ iocage fstab -a nextcloud /mnt/tank/apps/nextcloud/db /var/db/mysql nullfs rw 0 0

$ iocage fstab -a nextcloud /mnt/tank/apps/nextcloud/config /usr/local/www/nextcloud/config nullfs rw 0 0

$ iocage fstab -a nextcloud /mnt/tank/apps/nextcloud/themes /usr/local/www/nextcloud/themes nullfs rw 0 0



zfs set primarycache=metadata tank/apps/nextcloud/db


iocage list


iocage console nextcloud


$ pkg update

$ pkg install nano

$ pkg install wget ca_root_nss

$ pkg install apache24

$ sysrc apache24_enable=yes

$ service apache24 start

$ pkg install mariadb104-server

$ sysrc mysql_enable=yes


in /usr/local/etc/mysql/my.cnf : socket  = /tmp/mysql.sock

/usr/local/etc/rc.d/mysql-server start

mysql_secure_installation --socket=/tmp/mysql.sock

root@nextcloud:~ $ cd /tmp

root@nextcloud:/tmp $ wget https://download.nextcloud.com/server/releases/latest.tar.bz2

root@nextcloud:/tmp $ wget https://download.nextcloud.com/server/releases/latest.tar.bz2.sha512

shasum -a 512 -c latest.tar.bz2.sha512


tar -xf latest.tar.bz2 -C /usr/local/www

chown -R www:www /usr/local/www/nextcloud


pkg install php74 php74-bz2 php74-ctype php74-curl php74-dom php74-exif php74-fileinfo php74-filter php74-gd php74-iconv php74-intl php74-json php74-ldap php74-mbstring php74-opcache php74-openssl php74-pdo php74-pdo_mysql php74-pecl-APCu php74-pecl-imagick php74-pecl-redis php74-posix php74-session php74-simplexml php74-xml php74-xmlreader php74-xmlwriter php74-xsl php74-zip php74-zlib php74-bcmath php74-gmp


WARNING: FreeBSD 12.0-RELEASE HAS PASSED ITS END-OF-LIFE DATE.

Any security issues discovered after Sat Feb 29 08:00:00 +08 2020

will not have been corrected.

Installing updates... done.

Missing default rc.conf, creating it

nextcloud successfully created!

No default gateway found for ipv6.

* Starting nextcloud

  + Started OK

  + Using devfs_ruleset: 1000 (iocage generated default)

  + Configuring VNET OK

  + Using IP options: vnet

  + Starting services OK

  + Executing poststart OK




Tuesday, 22 December 2020

Another way to assign disks to TrueNas

 Thanks to Craft Computing :-)


root@mars:~# apt-get install lshw

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

  lshw

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 254 kB of archives.

After this operation, 781 kB of additional disk space will be used.

Get:1 http://ftp.debian.org/debian buster/main amd64 lshw amd64 02.18.85-0.1 [254 kB]

Fetched 254 kB in 10s (25.2 kB/s)

Selecting previously unselected package lshw.

(Reading database ... 51024 files and directories currently installed.)

Preparing to unpack .../lshw_02.18.85-0.1_amd64.deb ...

Unpacking lshw (02.18.85-0.1) ...

Setting up lshw (02.18.85-0.1) ...

Processing triggers for man-db (2.8.5-2) ...





root@mars:~# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0 558.8G  0 disk
├─sda1               8:1    0 558.8G  0 part
└─sda9               8:9    0     8M  0 part
sdb                  8:16   0 558.8G  0 disk
├─sdb1               8:17   0 558.8G  0 part
└─sdb9               8:25   0     8M  0 part
sdc                  8:32   0 558.8G  0 disk
├─sdc1               8:33   0 558.8G  0 part
└─sdc9               8:41   0     8M  0 part
sdd                  8:48   0 558.8G  0 disk
├─sdd1               8:49   0 558.8G  0 part
└─sdd9               8:57   0     8M  0 part
sde                  8:64   0 558.8G  0 disk
├─sde1               8:65   0 558.8G  0 part
└─sde9               8:73   0     8M  0 part
sdf                  8:80   0 558.8G  0 disk
├─sdf1               8:81   0 558.8G  0 part
└─sdf9               8:89   0     8M  0 part
sdg                  8:96   0 558.8G  0 disk
├─sdg1               8:97   0 558.8G  0 part
└─sdg9               8:105  0     8M  0 part
sdh                  8:112  0 558.8G  0 disk
sdi                  8:128  0 558.8G  0 disk
sdj                  8:144  0 558.8G  0 disk
sdk                  8:160  0 558.8G  0 disk
sdl                  8:176  0 558.8G  0 disk
sdm                  8:192  0 558.8G  0 disk
sdn                  8:208  0 558.8G  0 disk
sdo                  8:224  0 558.3G  0 disk
├─sdo1               8:225  0  1007K  0 part
├─sdo2               8:226  0   512M  0 part /boot/efi
└─sdo3               8:227  0 557.8G  0 part
  ├─pve-root       253:0    0    96G  0 lvm  /
  ├─pve-swap       253:1    0     8G  0 lvm  [SWAP]
  ├─pve-data_tmeta 253:2    0   4.4G  0 lvm
  │ └─pve-data     253:4    0   429G  0 lvm
  └─pve-data_tdata 253:3    0   429G  0 lvm
    └─pve-data     253:4    0   429G  0 lvm
sr0                 11:0    1  1024M  0 rom
zd0                230:0    0    50G  0 disk
├─zd0p1            230:1    0     1M  0 part
├─zd0p2            230:2    0     1G  0 part
└─zd0p3            230:3    0    49G  0 part
zd16               230:16   0    50G  0 disk
├─zd16p1           230:17   0   512K  0 part
└─zd16p2           230:18   0    50G  0 part
zd32               230:32   0    50G  0 disk
├─zd32p1           230:33   0     1G  0 part
└─zd32p2           230:34   0    49G  0 part
zd48               230:48   0    50G  0 disk
├─zd48p1           230:49   0     1G  0 part
└─zd48p2           230:50   0    49G  0 part




root@mars:~# ls -l /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Dec 19 23:06 ata-PLDS_DVD+_-RW_DS-8A9SH_8P71R550813CI40JVA00 -> ../../sr0
lrwxrwxrwx 1 root root 10 Dec 19 23:06 dm-name-pve-root -> ../../dm-0
lrwxrwxrwx 1 root root 10 Dec 19 23:06 dm-name-pve-swap -> ../../dm-1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 dm-uuid-LVM-MZlv4CZ1lawgUAmFlmypc2ALUFsjZ2RJJivRzI1a0LNpZRPXmtI21sU19mMOqIJ6 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 dm-uuid-LVM-MZlv4CZ1lawgUAmFlmypc2ALUFsjZ2RJTk9QkywOaWNmNZdeCBSHgzROlUdeEAjN -> ../../dm-0
lrwxrwxrwx 1 root root 11 Dec 19 23:06 lvm-pv-uuid-3hcjRP-E2Cb-65YQ-BeAP-2Ih6-i3m6-4440Jf -> ../../zd0p3
lrwxrwxrwx 1 root root 12 Dec 19 23:06 lvm-pv-uuid-BS0Ddm-jJd9-eYQB-UlNh-RH6N-haPF-HQkJdP -> ../../zd48p2
lrwxrwxrwx 1 root root 10 Dec 19 23:06 lvm-pv-uuid-GJZgVk-eecm-Xpfh-xeob-qWzx-put0-AC2KkE -> ../../sdo3
lrwxrwxrwx 1 root root 12 Dec 19 23:06 lvm-pv-uuid-qJ1cGB-DqoA-Vmvj-S65u-uPdX-HVYk-joYUn7 -> ../../zd32p2
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca01210dfa0 -> ../../sdl
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012151abc -> ../../sdn
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012199738 -> ../../sdh
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0121bad10 -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121bad10-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121bad10-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0121be358 -> ../../sdf
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121be358-part1 -> ../../sdf1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121be358-part9 -> ../../sdf9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0121de690 -> ../../sdd
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121de690-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121de690-part9 -> ../../sdd9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0121edc58 -> ../../sde
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121edc58-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121edc58-part9 -> ../../sde9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0121ef56c -> ../../sdg
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121ef56c-part1 -> ../../sdg1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0121ef56c-part9 -> ../../sdg9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0121f6d10 -> ../../sdi
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012b30390 -> ../../sda
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca012b30390-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca012b30390-part9 -> ../../sda9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012b4e91c -> ../../sdm
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012b539d8 -> ../../sdk
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012b5ceb4 -> ../../sdj
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca0595503b8 -> ../../sdb
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0595503b8-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-35000cca0595503b8-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-36c81f660de4d3a002767523311be93c6 -> ../../sdo
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-36c81f660de4d3a002767523311be93c6-part1 -> ../../sdo1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-36c81f660de4d3a002767523311be93c6-part2 -> ../../sdo2
lrwxrwxrwx 1 root root 10 Dec 19 23:06 scsi-36c81f660de4d3a002767523311be93c6-part3 -> ../../sdo3
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca01210dfa0 -> ../../sdl
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012151abc -> ../../sdn
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012199738 -> ../../sdh
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0121bad10 -> ../../sdc
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121bad10-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121bad10-part9 -> ../../sdc9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0121be358 -> ../../sdf
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121be358-part1 -> ../../sdf1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121be358-part9 -> ../../sdf9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0121de690 -> ../../sdd
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121de690-part1 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121de690-part9 -> ../../sdd9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0121edc58 -> ../../sde
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121edc58-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121edc58-part9 -> ../../sde9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0121ef56c -> ../../sdg
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121ef56c-part1 -> ../../sdg1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0121ef56c-part9 -> ../../sdg9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0121f6d10 -> ../../sdi
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b30390 -> ../../sda
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca012b30390-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca012b30390-part9 -> ../../sda9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b4e91c -> ../../sdm
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b539d8 -> ../../sdk
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b5ceb4 -> ../../sdj
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca0595503b8 -> ../../sdb
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0595503b8-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x5000cca0595503b8-part9 -> ../../sdb9
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x6c81f660de4d3a002767523311be93c6 -> ../../sdo
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x6c81f660de4d3a002767523311be93c6-part1 -> ../../sdo1
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x6c81f660de4d3a002767523311be93c6-part2 -> ../../sdo2
lrwxrwxrwx 1 root root 10 Dec 19 23:06 wwn-0x6c81f660de4d3a002767523311be93c6-part3 -> ../../sdo3

==============


lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca01210dfa0 -> ../../sdl
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012151abc -> ../../sdn
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012199738 -> ../../sdh
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b4e91c -> ../../sdm
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b539d8 -> ../../sdk
lrwxrwxrwx 1 root root  9 Dec 19 23:06 wwn-0x5000cca012b5ceb4 -> ../../sdj
lrwxrwxrwx 1 root root  9 Dec 19 23:06 scsi-35000cca012b5ceb4 -> ../../sdj


---

qm set 102 -scsi2 /dev/disk/by-id/scsi-35000cca0121f6d10 
qm set 102 -scsi3 /dev/disk/by-id/scsi-35000cca01210dfa0
qm set 102 -scsi4 /dev/disk/by-id/scsi-35000cca012151abc 
qm set 102 -scsi5 /dev/disk/by-id/scsi-35000cca012199738 
qm set 102 -scsi6 /dev/disk/by-id/scsi-35000cca012b4e91c 
qm set 102 -scsi7 /dev/disk/by-id/scsi-35000cca012b539d8 
qm set 102 -scsi8 /dev/disk/by-id/scsi-35000cca012b5ceb4


----------


root@mars:~# qm set 102 -scsi3 /dev/disk/by-id/scsi-35000cca01210dfa0
qm set 102 -scsi4 /dev/disk/by-id/scsi-35000cca012151abc
qm set 102 -scsi5 /dev/disk/by-id/scsi-35000cca012199738
qm set 102 -scsi6 /dev/disk/by-id/scsi-35000cca012b4e91c
qm set 102 -scsi7 /dev/disk/by-id/scsi-35000cca012b539d8
qm set 102 -scsi8 /dev/disk/by-id/scsi-35000cca012b5ceb4
update VM 102: -scsi3 /dev/disk/by-id/scsi-35000cca01210dfa0
root@mars:~# qm set 102 -scsi4 /dev/disk/by-id/scsi-35000cca012151abc
update VM 102: -scsi4 /dev/disk/by-id/scsi-35000cca012151abc
root@mars:~# qm set 102 -scsi5 /dev/disk/by-id/scsi-35000cca012199738
update VM 102: -scsi5 /dev/disk/by-id/scsi-35000cca012199738
root@mars:~# qm set 102 -scsi6 /dev/disk/by-id/scsi-35000cca012b4e91c
update VM 102: -scsi6 /dev/disk/by-id/scsi-35000cca012b4e91c
root@mars:~# qm set 102 -scsi7 /dev/disk/by-id/scsi-35000cca012b539d8
update VM 102: -scsi7 /dev/disk/by-id/scsi-35000cca012b539d8
root@mars:~# qm set 102 -scsi8 /dev/disk/by-id/scsi-35000cca012b5ceb4
update VM 102: -scsi8 /dev/disk/by-id/scsi-35000cca012b5ceb4

Saturday, 19 December 2020

PCI Passthrough for TrueNas on R720

 Reference: Pci passthrough - Proxmox VE


vi /etc/default/grub

amend: GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on" 

update-grub

root@mars:~# dmesg | grep -e DMAR -e IOMMU

[    0.024470] ACPI: DMAR 0x000000007D3346F4 0000F0 (v01 DELL   PE_SC3   00000001 DELL 00000001)

[    1.207702] DMAR: Host address width 46

[    1.207703] DMAR: DRHD base: 0x000000dc900000 flags: 0x1

[    1.207707] DMAR: dmar0: reg_base_addr dc900000 ver 1:0 cap d2078c106f0462 ecap f020fe

[    1.207708] DMAR: RMRR base: 0x0000007f458000 end: 0x0000007f46ffff

[    1.207709] DMAR: RMRR base: 0x0000007f450000 end: 0x0000007f450fff

[    1.207710] DMAR: RMRR base: 0x0000007f452000 end: 0x0000007f452fff

[    1.207710] DMAR: ATSR flags: 0x0

[    1.207712] DMAR-IR: IOAPIC id 0 under DRHD base  0xdc900000 IOMMU 0

[    1.207713] DMAR-IR: IOAPIC id 1 under DRHD base  0xdc900000 IOMMU 0

[    1.207714] DMAR-IR: HPET id 0 under DRHD base 0xdc900000

[    1.207714] DMAR-IR: x2apic is disabled because BIOS sets x2apic opt out bit.

[    1.207715] DMAR-IR: Use 'intremap=no_x2apic_optout' to override the BIOS setting.

[    1.208001] DMAR-IR: Enabled IRQ remapping in xapic mode

root@mars:~# vi /etc/kernel/cmdline

root@mars:~# vi /etc/default/grub

root@mars:~# update-grub

Generating grub configuration file ...

Found linux image: /boot/vmlinuz-5.4.78-2-pve

Found initrd image: /boot/initrd.img-5.4.78-2-pve

Found linux image: /boot/vmlinuz-5.4.34-1-pve

Found initrd image: /boot/initrd.img-5.4.34-1-pve

Found memtest86+ image: /boot/memtest86+.bin

Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin

done

root@mars:~# pve-efiboot-tool refresh

Running hook script 'pve-auto-removal'..

Running hook script 'zz-pve-efiboot'..

Re-executing '/etc/kernel/postinst.d/zz-pve-efiboot' in new private mount namespace..

No /etc/kernel/pve-efiboot-uuids found, skipping ESP sync.



After that reboot, ran into problems... see this:

IOMMU – DMAR fault – PTE Read access is not set – Centoros (wordpress.com)


Tuesday, 15 December 2020

ZFS ....

 Here's a good short intro on ZFS:

https://www.diskinternals.com/raid-recovery/what-is-raidz/


And a more detailed one:

https://www.delphix.com/blog/delphix-engineering/zfs-raidz-stripe-width-or-how-i-learned-stop-worrying-and-love-raidz


I am going with RAID Z2 which basically allows up to 2 drives to fail in my setup for my R720 with 7x 600GB drives.

Non-raid disks on PERC H310 Mini

On my R720, I have an embedded PERC H310 Mini. I didn't realise it supports pass through if you configure the disks as non-raid.. this is cool.. i actually didn't need to get those other HBA cards. :-(

But anyway, I will need them for my R710 in future.

Some controllers can turn this on/off but the 310 does not. Check this: https://www.mrvsan.com/configuring-the-dell-perc-h730-controller-for-passthrough-and-raid/




Monday, 14 December 2020

Minecraft Server on my homelab

 Running minecraft bedrock on my R720:


download from here:  

https://www.minecraft.net/en-us/download/server/bedrock

https://minecraft.azureedge.net/bin-linux/bedrock-server-1.16.200.02.zip


to turn on cheats: https://shockbyte.com/billing/knowledgebase/184/How-to-Enable-Cheats-on-Your-Bedrock-Server.html

to turn on coordinates: https://shockbyte.com/billing/knowledgebase/201/How-to-Enable-Coordinates-on-Your-Minecraft-Bedrock-Server.html#:~:text=On%20your%20Multicraft%20control%20panel,in%2Dgame%20as%20shown%20below.

Remote installation using DELL IDRAC

 Here is a very good link:

Using the Virtual Media function on iDRAC 6, 7, 8 and 9 | Dell Singapore













Sunday, 6 December 2020

How to map sg to sd

 root@venus:/dev# sg_map

/dev/sg0  /dev/sr0

/dev/sg1  /dev/sda

/dev/sg2  /dev/sdb

/dev/sg3  /dev/sdc

/dev/sg4  /dev/sdd

/dev/sg5  /dev/sde

/dev/sg6  /dev/sdf

/dev/sg7  /dev/sdg

/dev/sg8  /dev/sdh

/dev/sg9  /dev/sdi

/dev/sg10  /dev/sdj

/dev/sg11  /dev/sdk

/dev/sg12  /dev/sdl

/dev/sg13  /dev/sdm

/dev/sg14  /dev/sdn

/dev/sg15  /dev/sdo

/dev/sg16  /dev/sdp

/dev/sg17  /dev/sdq

/dev/sg18  /dev/sdr

/dev/sg19  /dev/sds

/dev/sg20  /dev/sdt

/dev/sg21  /dev/sdu

/dev/sg22  /dev/sdv

/dev/sg23  /dev/sdw

/dev/sg24  /dev/sdx

/dev/sg25  /dev/sdy

/dev/sg26  /dev/sdz

/dev/sg27  /dev/sdaa

/dev/sg28  /dev/sdab

/dev/sg29


Thursday, 26 November 2020

Proxmox pvesem

 root@venus:~# pvesm status

zfs error: cannot open 'VMs': no such pool


zfs error: cannot open 'VMs': no such pool


could not activate storage 'VMs', zfs error: cannot open 'VMs': no such pool


Name             Type     Status           Total            Used       Available        %

VMs           zfspool   inactive               0               0               0    0.00%

local             dir     active        34571888         2656612        30129420    7.68%

local-lvm     lvmthin     active        79556608               0        79556608    0.00%

root@venus:~# pvesm remove VMs

root@venus:~# pvesm status

Name             Type     Status           Total            Used       Available        %

local             dir     active        34571888         2656624        30129408    7.68%

local-lvm     lvmthin     active        79556608               0        79556608    0.00%


Proxmox Device Mapper

 


If your device is shown as Device Mapper, you can't create a new filesystem.

Try these commands:

root@venus:/# sgdisk --zap-all /dev/sdc

Creating new GPT entries.

GPT data structures destroyed! You may now partition the disk using fdisk or

other utilities.


See this thread:

ProxMox - Clearing disks for use | ServeTheHome Forums


Sunday, 22 November 2020

Delete ZFS on Proxmox

 root@pve:~# zpool destroy Local-Proxmox

root@pve:~# zpool list

no pools available

root@pve:~# dd if=/dev/zero of=/dev/sdb bs=4096 count=35

35+0 records in

35+0 records out

143360 bytes (143 kB, 140 KiB) copied, 0.000806736 s, 178 MB/s


root@pve:~# dd if=/dev/zero of=/dev/sdb bs=4096 count=35 seek=$(($(blockdev --getsz /dev/sdb)*512/4096 - 35))

35+0 records in

35+0 records out

143360 bytes (143 kB, 140 KiB) copied, 0.00118329 s, 121 MB/s

Thursday, 19 November 2020

Reduce fan speed on my Dell R710

Refer to: https://www.reddit.com/r/homelab/comments/b20p7o/super_easy_way_to_make_an_r710_really_quiet


 [root@database client]# yum install ipmitool

Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager

Resolving Dependencies

--> Running transaction check

---> Package ipmitool.x86_64 0:1.8.18-9.el7_7 will be installed

--> Processing Dependency: OpenIPMI-modalias for package: ipmitool-1.8.18-9.el7_7.x86_64

--> Running transaction check

---> Package OpenIPMI-modalias.x86_64 0:2.0.27-1.el7 will be installed

--> Processing Dependency: OpenIPMI for package: OpenIPMI-modalias-2.0.27-1.el7.x86_64

--> Running transaction check

---> Package OpenIPMI.x86_64 0:2.0.27-1.el7 will be installed

--> Processing Dependency: OpenIPMI-libs = 2.0.27-1.el7 for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Processing Dependency: libOpenIPMI.so.0()(64bit) for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Processing Dependency: libOpenIPMIcmdlang.so.0()(64bit) for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Processing Dependency: libOpenIPMIglib.so.0()(64bit) for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Processing Dependency: libOpenIPMIposix.so.0()(64bit) for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Processing Dependency: libOpenIPMIui.so.1()(64bit) for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Processing Dependency: libOpenIPMIutils.so.0()(64bit) for package: OpenIPMI-2.0.27-1.el7.x86_64

--> Running transaction check

---> Package OpenIPMI-libs.x86_64 0:2.0.27-1.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


==============================================================================================================================================================================================

 Package                                          Arch                                  Version                                       Repository                                         Size

==============================================================================================================================================================================================

Installing:

 ipmitool                                         x86_64                                1.8.18-9.el7_7                                rhel-7-server-rpms                                442 k

Installing for dependencies:

 OpenIPMI                                         x86_64                                2.0.27-1.el7                                  rhel-7-server-rpms                                243 k

 OpenIPMI-libs                                    x86_64                                2.0.27-1.el7                                  rhel-7-server-rpms                                523 k

 OpenIPMI-modalias                                x86_64                                2.0.27-1.el7                                  rhel-7-server-rpms                                 16 k


Transaction Summary

==============================================================================================================================================================================================

Install  1 Package (+3 Dependent packages)


Total download size: 1.2 M

Installed size: 3.8 M

Is this ok [y/d/N]: y

Downloading packages:

(1/4): OpenIPMI-2.0.27-1.el7.x86_64.rpm                                                                                                                                | 243 kB  00:00:00

(2/4): OpenIPMI-libs-2.0.27-1.el7.x86_64.rpm                                                                                                                           | 523 kB  00:00:00

(3/4): OpenIPMI-modalias-2.0.27-1.el7.x86_64.rpm                                                                                                                       |  16 kB  00:00:00

(4/4): ipmitool-1.8.18-9.el7_7.x86_64.rpm                                                                                                                              | 442 kB  00:00:00

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                                         1.5 MB/s | 1.2 MB  00:00:00

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : OpenIPMI-modalias-2.0.27-1.el7.x86_64                                                                                                                                      1/4

  Installing : OpenIPMI-libs-2.0.27-1.el7.x86_64                                                                                                                                          2/4

  Installing : OpenIPMI-2.0.27-1.el7.x86_64                                                                                                                                               3/4

  Installing : ipmitool-1.8.18-9.el7_7.x86_64                                                                                                                                             4/4

WARNING: ipmi_devintf module isn't available.

WARNING: ipmi_msghandler module isn't available.

  Verifying  : OpenIPMI-libs-2.0.27-1.el7.x86_64                                                                                                                                          1/4

  Verifying  : ipmitool-1.8.18-9.el7_7.x86_64                                                                                                                                             2/4

  Verifying  : OpenIPMI-2.0.27-1.el7.x86_64                                                                                                                                               3/4

  Verifying  : OpenIPMI-modalias-2.0.27-1.el7.x86_64                                                                                                                                      4/4


Installed:

  ipmitool.x86_64 0:1.8.18-9.el7_7


Dependency Installed:

  OpenIPMI.x86_64 0:2.0.27-1.el7                            OpenIPMI-libs.x86_64 0:2.0.27-1.el7                            OpenIPMI-modalias.x86_64 0:2.0.27-1.el7


Complete!

[root@database client]# ipmitool

Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory

[root@database client]# ipmitool -H 192.168.1.8 -I lanplus -U root -P P@ssw0rd mc info

Device ID                 : 32

Device Revision           : 0

Firmware Revision         : 2.85

IPMI Version              : 2.0

Manufacturer ID           : 674

Manufacturer Name         : DELL Inc

Product ID                : 256 (0x0100)

Product Name              : Unknown (0x100)

Device Available          : yes

Provides Device SDRs      : yes

Additional Device Support :

    Sensor Device

    SDR Repository Device

    SEL Device

    FRU Inventory Device

    IPMB Event Receiver

    Bridge

    Chassis Device

Aux Firmware Rev Info     :

    0x00

    0x04

    0x00

    0x00






Thursday, 5 November 2020

Promox Nag

 Learnt a new term .. :-)


https://gist.github.com/whiskerz007/53c6aa5d624154bacbbc54880e1e3b2a

Thursday, 29 October 2020

My other VNX saviour

Arrived 1 day later, this one is a Dell H200E, the earlier one I'd a HP one but still works fine on my R710.

Reformating my Hitachi Drives from 520b to 512b

 root@pve:~#  sg_readcap /dev/sg2

Read Capacity results:

   Last LBA=1125768575 (0x4319dd7f), Number of logical blocks=1125768576

   Logical block length=520 bytes

Hence:

   Device size: 585399659520 bytes, 558280.6 MiB, 585.40 GB




root@pve:~# sg_format --format --size=512 /dev/sg2
    HITACHI   HUC10606 CLAR600  C260   peripheral_type: disk [0x0]
      << supports protection information>>
      Unit serial number: PPG98NYB
      LU name: 5000cca01210dfa0
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=1125768576 [0x4319dd80]
  Block size=520 [0x208]

A FORMAT UNIT will commence in 15 seconds
    ALL data on /dev/sg2 will be DESTROYED
        Press control-C to abort

A FORMAT UNIT will commence in 10 seconds
    ALL data on /dev/sg2 will be DESTROYED
        Press control-C to abort

A FORMAT UNIT will commence in 5 seconds
    ALL data on /dev/sg2 will be DESTROYED
        Press control-C to abort

Format unit has started
Format in progress, 1.99% done
Format in progress, 3.99% done
^C
root@pve:~#  sg_readcap /dev/sg2
READ CAPACITY (10) failed: Device not ready
sg_readcap failed: Device not ready
root@pve:~#  sg_readcap /dev/sg2
READ CAPACITY (10) failed: Device not ready
sg_readcap failed: Device not ready
root@pve:~#  sg_readcap /dev/sg2
READ CAPACITY (10) failed: Device not ready
sg_readcap failed: Device not ready


I had to abort it just now because it was late and the VNX was too noisy, Hope I don't end up with a brick drive:
http://www.ndwiki.org/wiki/User:Tingo/sg3_utils

Install sg-utils on Promox (Debian)

Good summary of sg3_utils:

http://www.ndwiki.org/wiki/User:Tingo/sg3_utils 


root@pve:~# apt-get update

Get:1 http://security.debian.org buster/updates InRelease [65.4 kB]

Get:2 http://security.debian.org buster/updates/main amd64 Packages [243 kB]

Get:3 http://security.debian.org buster/updates/main Translation-en [133 kB]

Get:4 http://ftp.debian.org/debian buster InRelease [121 kB]

Get:5 http://ftp.debian.org/debian buster-updates InRelease [51.9 kB]

Get:6 http://ftp.debian.org/debian buster/main amd64 Packages [7,906 kB]

Get:7 http://ftp.debian.org/debian buster/main Translation-en [5,968 kB]

Get:8 http://ftp.debian.org/debian buster/contrib amd64 Packages [50.5 kB]

Get:9 http://ftp.debian.org/debian buster/contrib Translation-en [44.5 kB]

Get:10 http://ftp.debian.org/debian buster-updates/main amd64 Packages [7,856 B]

Get:11 http://ftp.debian.org/debian buster-updates/main Translation-en [5,672 B]

Err:12 https://enterprise.proxmox.com/debian/pve buster InRelease

  401  Unauthorized [IP: 51.79.159.216 443]

Reading package lists... Done

E: Failed to fetch https://enterprise.proxmox.com/debian/pve/dists/buster/InRelease  401  Unauthorized [IP: 51.79.159.216 443]

E: The repository 'https://enterprise.proxmox.com/debian/pve buster InRelease' is not signed.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.




root@pve:~# sg_scan -i

/dev/sg0: scsi0 channel=0 id=0 lun=0 [em]

    TSSTcorp  DVD+-RW TS-L633C  D250 [rmb=1 cmdq=0 pqual=0 pdev=0x5]

/dev/sg1: scsi2 channel=2 id=0 lun=0

    DELL  PERC H700  2.10 [rmb=0 cmdq=1 pqual=0 pdev=0x0]

/dev/sg2: scsi3 channel=0 id=0 lun=0

    HITACHI   HUC10606 CLAR600  C260 [rmb=0 cmdq=1 pqual=0 pdev=0x0]

/dev/sg3: scsi3 channel=0 id=1 lun=0

    HITACHI   HUC10606 CLAR600  C260 [rmb=0 cmdq=1 pqual=0 pdev=0x0]

/dev/sg4: scsi3 channel=0 id=2 lun=0

    HITACHI   HUC10606 CLAR600  C260 [rmb=0 cmdq=1 pqual=0 pdev=0x0]

/dev/sg5: scsi3 channel=0 id=3 lun=0

    HITACHI   HUC10606 CLAR600  C260 [rmb=0 cmdq=1 pqual=0 pdev=0x0]

/dev/sg6: scsi3 channel=0 id=4 lun=0

    HITACHI   HUC10606 CLAR600  C330 [rmb=0 cmdq=1 pqual=0 pdev=0x0]

/dev/sg7: scsi3 channel=0 id=5 lun=0

    EMC       ESES Enclosure    0001 [rmb=0 cmdq=1 pqual=0 pdev=0xd]




root@pve:~# apt-get install sg3-utils

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  libsgutils2-2

The following NEW packages will be installed:

  libsgutils2-2 sg3-utils

0 upgraded, 2 newly installed, 0 to remove and 44 not upgraded.

Need to get 949 kB of archives.

After this operation, 2,951 kB of additional disk space will be used.

Do you want to continue? [Y/n] Y

Get:1 http://ftp.debian.org/debian buster/main amd64 libsgutils2-2 amd64 1.44-1 [112 kB]

Get:2 http://ftp.debian.org/debian buster/main amd64 sg3-utils amd64 1.44-1 [837 kB]

Fetched 949 kB in 2s (536 kB/s)

Selecting previously unselected package libsgutils2-2.

(Reading database ... 44066 files and directories currently installed.)

Preparing to unpack .../libsgutils2-2_1.44-1_amd64.deb ...

Unpacking libsgutils2-2 (1.44-1) ...

Selecting previously unselected package sg3-utils.

Preparing to unpack .../sg3-utils_1.44-1_amd64.deb ...

Unpacking sg3-utils (1.44-1) ...

Setting up libsgutils2-2 (1.44-1) ...

Setting up sg3-utils (1.44-1) ...

Processing triggers for man-db (2.8.5-2) ...

Processing triggers for libc-bin (2.28-10) ...


Wednesday, 28 October 2020

How to reset EXSi password

 I am using this as a guide:

https://www.altaro.com/vmware/reset-esxi-root-password/

https://www.vmwareblog.org/forgot-esxi-root-password-no-problems-4-ways-reset/




Mine should be /dev/sdb5



After untar:





 


BTW, need to this for both sdb5 and sdb6 (easier to just copy across coz I tried to do 2x and ended up with some MD5 error).

My VNX saviour?

This just arrived !!!

Perc 5/E

 On one of the R710 I have, I found out that I have a  Perc 5/E card.

But it uses SFF-8470 connector. The VNX uses SFF-8088.

More details:  https://en.wikipedia.org/wiki/Serial_Attached_SCSI


So here is what I bought:



Thursday, 22 October 2020

Backend cabling for VNX

 Here's how:




https://www.dell.com/community/VNX/Backend-cabling-for-the-VNX5400-block/td-p/7149511

VNX as a JBOD

 To run the VNX disks as JBOD, I will need to get a HBA or raid card that runs in IT mode.

I've ordered 2 cards:

H200E

LSI-92800-e


The H200E is actually a DELL branded of the LSI card.




Monday, 19 October 2020

Useful links on the VNX

 https://www.reddit.com/r/homelab/comments/662zrj/how_to_use_an_emc_dae_from_an_ax45i_as_das/


https://www.storagefreak.net/2014/05/emc-vnx-different-types-of-disk-shelves

Sunday, 18 October 2020

Need to reformat the Hitachi drives

 Here's a good link on this:

https://forum.level1techs.com/t/how-to-reformat-520-byte-drives-to-512-bytes-usually/133021

https://mikeyurick.com/reformat-emc-hard-drives-to-use-in-other-systems-520-to-512-block-size-conversion-solved/

https://wp.colliertech.org/cj/?p=1802


But the problem is that the drives are connected via my Perc H800 controller but it is not passing the drive to the OS (Debian by Promox).



Wanna buy cheap DC drives:

https://www.servethehome.com/buyers-guide-datacenter-ssd-inexpensively/

How to use the EMC VNX to direct attach ?

 Hmmm.. still scratching my head.. some tips here:

https://serverfault.com/questions/895706/connecting-emc-vnx-6g-dae-to-server-using-sas

https://www.jpaul.me/2012/11/anatomy-of-an-emc-vnx-array/comment-page-2/


Seems like mine is VNX 5200 DAE

Thursday, 15 October 2020

Sunday, 11 October 2020

Reseting Administrator password on Windows 2008

 Here is how I did it:


1. Create a boot disk using Hiren’s BootCD PE

https://www.hirensbootcd.org/download/


2. Boot using this USB disk and open a command prompt and execute the following steps:

  • At the command prompt, run the following commands:

    c:
    cd windows\system32
    ren Utilman.exe Utilman.exe.old
    copy cmd.exe Utilman.exe

  • Reboot the server allowing Windows to load as normal
  • At the logon screen, press Windows Key + U.
  • As the command prompt, enter the following command:

    net user administrator Password12
    This will set the password for the Administrator user to be Password12 (case sensitive).


3. Once you have verified you can log on to the server you will have repeat the steps above and boot using the Windows Server 2008 DVD/ISO and run the command prompt again.

Delete the newly created Utilman.exe from C:\Windows\System32
Rename Utilman.exe.old back to Utilman.exe
You should be back up and running as if nothing ever happened.

Arcsight BIOS on the new motherboard

 When I boot up my R710 after swapping the motherboard, I found out that it is not the Dell BIOS!


After flashing with the latest BIOS update, no version exists.. and I can't apply other updates. 


To resolve, this, I have force the BIOS update again. 

Here is what I did :

1. Use Rufus to create a PC-DOS USB  boot disk

2. Ensure BIOS boot mode is BIOS (not EFI)

3. Boot from the USB

4. Run the BIOS update (R710-060600C.exe) with /FORCETYPE option... now it is back to normal!


Motherboard switch out on R710

Stripped!
New motherboard going in..

Yes! Yes! Yes! it finally arrived

Replacement motherboard for Dell r710.. after getting shipped to the wrong address, it finally arrived 🙂

Wednesday, 7 October 2020

Correct way to change port.. this should work - ignore previous one

 

  1. edit "/etc/vmware/rhttpproxy/config.xml" (<httpsPort>443</httpsPort> to <httpsPort>4444</httpsPort>)

  2. run command "/etc/init.d/rhttpproxy restart"

  3. create new file "/etc/vmware/firewall/changes.xml"

  4. copy this text to file:

<ConfigRoot>
    <service>
        <id>changedport</id>
        <rule id='0000'>
            <direction>inbound</direction>
            <protocol>tcp</protocol>
            <porttype>dst</porttype>
            <port>4444</port>
        </rule>
        <enabled>true</enabled>
        <required>false</required>
    </service>
</ConfigRoot>
  1. run command "/sbin/esxcli network firewall refresh"

  2. copy above file into /vmfs/volumes/xxxxxxx-80925220-52bf-b8ac6f41950b/changes.xml

  3. add below code to "/etc/rc.local.d/local.sh" for work after reboot:

/sbin/cp /vmfs/volumes/xxxxxxx-80925220-52bf-b8ac6f41950b/changes.xml/ etc/vmware/firewall/

/sbin/esxcli network firewall refresh

exit 0

done.

Change Exsi port

 https://stackoverflow.com/questions/53400427/how-can-i-change-default-port-80-and-443-in-esxi-host-6-7



1. enable ssh on esxi host
2. connect via ssh or press alt + f1 on esxi host
3. edit this file by command vi /etc/vmware/rhttpproxy/config.xml
4. find text https by command :/https
<!-- HTTPS port to be used by the reverse proxy -->
<httpsPort>443</httpsPort>
5. change port to eg. 9443 
(press insert before editing and after finished press esc save it by :wq)
6. reboot needed by command reboot
7. after reboot connect to ssh and create new file changedport.xml by command 
vi /etc/vmware/firewall/changedport.xml
8. copy this text to console.
<ConfigRoot>
  <service>
    <id>changedport</id>
    <rule id='0000'>
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>9443</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>
</ConfigRoot>
9. save it by :wq
10. refresh firewall rules by command esxcli network firewall refresh

Thursday, 1 October 2020

Power meter to measure electricity usage

With all these servers running, I decided to monitor my usage using a power meter.

Server Rack!! (2 days ago)

I got a server rack for $100.. but moving it costs $280! 

Some misc parts:

Original item on sale:

SCP/SSH between ESXi hosts

do this first:

esxcli network firewall set -e false


ssh root@192.168.1.201

FIPS mode initialized

The authenticity of host '192.168.1.201 (192.168.1.201)' can't be established.

RSA key fingerprint is SHA256:Kv8k7Ctzj/SPC62Vq+GJwPQ4vlh/FSrXDijIA3+Pbj0.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.1.201' (RSA) to the list of known hosts.



Friday, 18 September 2020

Thursday, 10 September 2020

Supermicro up next ?

 With me doing alot of testing on OpenShift and Kurbenetes, my current Intel NUC10i7FNH is quickly running out juice.

https://www.starwindsoftware.com/blog/choosing-ideal-mini-server-for-a-home-lab


Been researching abit on Supermicro E200/E300 servers, here are some nice setups:

https://theithollow.com/2020/02/15/2020-home-lab/

https://www.virtualizationhowto.com/2020/06/supermicro-vmware-home-lab/

https://www.virtuallyghetto.com/2018/11/supermicro-e300-9d-sys-e300-9d-8cn8tp-is-a-nice-esxi-vsan-kit.html

https://edywerder.ch/vmware-esxi-barebone-homelab/


Considering either the E300 or E301:

https://www.supermicro.com/en/products/system/Mini-ITX/SYS-E300-9D-8CN8TP.cfm

https://www.supermicro.com/en/products/system/Mini-ITX/SYS-E301-9D-8CN8TP.cfm


Reviews:

https://www.servethehome.com/supermicro-as-e301-9d-8cn4-review-embedded-epyc-appliance/


Possible place to buy:

https://mitxpc.com/collections/networking


HCL (SYS-E300-9D-8CN8TP)

https://www.vmware.com/resources/compatibility/search.php?deviceCategory=server&details=1&partner=105&keyword=SYS-E300-9D-8CN8TP&systemTypes=2&page=1&display_interval=10&sortColumn=Partner&sortOrder=Asc

Thursday, 27 August 2020

Adding a new vSwitch & portgroup

 [root@ESXi01:~] esxcli network vswitch standard add -v vSwitch1 -P 3456

[root@ESXi01:~] esxcli network nic list

Name    PCI Device    Driver  Admin Status  Link Status  Speed  Duplex  MAC Address         MTU  Description

------  ------------  ------  ------------  -----------  -----  ------  -----------------  ----  -----------

vmnic0  0000:00:1f.6  ne1000  Up            Up            1000  Full    1c:69:7a:6b:a3:e5  1500  Intel Corporation Ethernet Connection (10) I219-V

vusb0   Pseudo        uether  Up            Up             100  Full    00:e0:4c:36:00:d1  1500  Realtek USB 10100 LAN

vusb1   Pseudo        uether  Up            Up             100  Full    00:e0:4c:36:01:44  1500  Realtek USB 10100 LAN

[root@ESXi01:~]  esxcli network vswitch standard list

vSwitch0

   Name: vSwitch0

   Class: cswitch

   Num Ports: 3456

   Used Ports: 11

   Configured Ports: 128

   MTU: 1500

   CDP Status: listen

   Beacon Enabled: false

   Beacon Interval: 1

   Beacon Threshold: 3

   Beacon Required By:

   Uplinks: vmnic0

   Portgroups: VM Network, Management Network


WAN

   Name: WAN

   Class: cswitch

   Num Ports: 3456

   Used Ports: 4

   Configured Ports: 128

   MTU: 1500

   CDP Status: listen

   Beacon Enabled: false

   Beacon Interval: 1

   Beacon Threshold: 3

   Beacon Required By:

   Uplinks: vusb0

   Portgroups: WAN


vSwitch1

   Name: vSwitch1

   Class: cswitch

   Num Ports: 3456

   Used Ports: 1

   Configured Ports: 3456

   MTU: 1500

   CDP Status: listen

   Beacon Enabled: false

   Beacon Interval: 1

   Beacon Threshold: 3

   Beacon Required By:

   Uplinks:

   Portgroups:

[root@ESXi01:~] esxcli network vswitch standard uplink add -u vusb1 -v vSwitch1

[root@ESXi01:~]  esxcli network vswitch standard list

vSwitch0

   Name: vSwitch0

   Class: cswitch

   Num Ports: 3456

   Used Ports: 11

   Configured Ports: 128

   MTU: 1500

   CDP Status: listen

   Beacon Enabled: false

   Beacon Interval: 1

   Beacon Threshold: 3

   Beacon Required By:

   Uplinks: vmnic0

   Portgroups: VM Network, Management Network


WAN

   Name: WAN

   Class: cswitch

   Num Ports: 3456

   Used Ports: 4

   Configured Ports: 128

   MTU: 1500

   CDP Status: listen

   Beacon Enabled: false

   Beacon Interval: 1

   Beacon Threshold: 3

   Beacon Required By:

   Uplinks: vusb0

   Portgroups: WAN


vSwitch1

   Name: vSwitch1

   Class: cswitch

   Num Ports: 3456

   Used Ports: 3

   Configured Ports: 3456

   MTU: 1500

   CDP Status: listen

   Beacon Enabled: false

   Beacon Interval: 1

   Beacon Threshold: 3

   Beacon Required By:

   Uplinks: vusb1

   Portgroups:



Add a new port group :

esxcli network vswitch standard portgroup add -p OKD -v vSwitch1