Day: December 23, 2021

Migrate TrueNAS VM to Proxmox VM

Migrate TrueNAS VM to Proxmox VM

After Proxmox installed, I also migrate TrueNAS VM to Proxmox as VM for both Ubuntu VM and Windows 10 VM.

Copy zvol to a file and transfer to Proxmox server

The zpool volume device is located in /dev/zvol/<zpool_name>/<zvol_name>. Create disk image using following command.

dd if=/dev/zvol/pool0/server-xxxxxx of=/tmp/server.raw bs=8m
scp ...

Another way to transfer

dd if=/dev/zvol/.... bs=8192 status=progress | ssh root@proxmox 'dd of=....raw bs=8192'

or

dd if=/dev/zvol/.... bs=8192 status=progress | gzip -1 - | ssh root@proxmox 'dd of=....raw.gz bs=8192'

or

dd if=/dev/zvol/.... bs=8192 status=progress | gzip -1 - | ssh root@proxmox 'gunzip - | dd of=....raw.gz bs=8192'

Transfer raw file into Proxmox server

Create Proxmox VM

  • Create a VM with OVMF (UEFI) if TrueNAS VM is using UEFI

  • Remove VM disk

  • Use following command to import disk

qm importdisk <vm_id> <raw_file> <storage_id>

For example

qm importdisk 100 vm.raw ds1812-vm_nfs1
  • Go to VM hardware page

  • Select unused disk and click Add button to add disk into VM

    • For Linux, select SCSI as controller
    • For Windows, select SATA
  • Select Options => Boot Order to check the iscsi/sata controller

Boot TrueNAS VM

References

Export Virtual Machine from TrueNAS and Import VM to Proxmox
Migration of servers to Proxmox VE
Additional ways to migrate to Proxmox VE

Add PAM user in Proxmox as Admin

Add PAM user in Proxmox

Create user in OS

groupadd <group>
adduser -g <group> <user>
passwd <user>
mkdir ~<user>
chown <user>:<group> ~<user>

Add OS user to Proxmox

pveum user add <user>@pam
pveum user list

Add role to user

pveum acl modify <PATH> --roles PVEAdmin --users <user>@pam

For example

acl modify / --roles PVEAdmin --users user@pam

References

Add pam user to pve admin group?
users cant change own passwords
User Management

Usable Image with Different Size in WordPress

Usable Image with Different Size in WordPress

I was trying to find out the available pictures for same image in WordPress to enable fast download of small pictures in same page.

There are many pictures in different size, they can be found in WordPress html folder. Depending on the media configuration, maybe in different location. Here, only lists default location.

Location

The resized images files are in html/wp-content/uploads/<year>/<month> directory as the format of <picture_name>-<width>x<height>.jpg.

URL

Original image

Can be found at bottom Edit Media page as <picture_name>.jpg.

Scaled image

Can be found in text box File URL as <picture_name>-scaled.jpg

Other size images

Can change the scaled image URL to <picture_name>-<width>x<height>.jpg