ktrace / pxmx-ctld

ProxMox plugin for FreeBSD/ctld iSCSI target as backend
MIT License
2 stars 1 forks source link

Resize not working #1

Open josiaslg opened 3 years ago

josiaslg commented 3 years ago

Hi. I tested the driver on proxmox 6.3.x and 6.4.x. One problem that occurs is the resize. To reproduce follow the steps:

  1. Select the VM.
  2. Click Hardware.
  3. Select storage disk.
  4. Click Resize.
  5. Enter the increment in GB and click OK.

An error phrase will appear saying that the lun could not be located.

On FreeBSD the volume has been updated (ie incremented).

Temporary operation:

  1. After the error click ok.
  2. On FreeNSD SAN (where the ctld is) do /etc/rc.d/ctld reload (so the new size will be updated via iscsi).
  3. In Proxmox, dettach the HD and attach again. Okay, it will appear with the new size in proxmox. Now just enter in VM and do the internal operation of extending.
josiaslg commented 3 years ago

New proposition for CTLD.pm CTLD.pm.txt

Tests made:

Add Disk : OK Resize Disk : OK. Snapshot : OK (see notes). Delete Disk : OK.

Additional: Now blocksize 4096 is set each new LUN.

Notes: Snapshot: When created, the zfs on freebsd create a new subvol and a new LUN. I'm not sure if is that expected, but this way, recover a deleted disk is possible because the snapshot is a disk on other subvol. If was a pure snapshot, zfs destroy -r pool/subvol will destroy any possibility to recover. Anyway the Rollback function on Proxmox works like expected. Delete snapshot works like expected (the LUN is deleted from cfg).

I remove the ctladm from commands from now. I have many troubles with duplicated LUNs and this is bad. I choose edit /etc/ctl.conf and /etc/rc.d/ctld reload. The reload parameter will reload without drop connection (just the removed LUN will be changed). "When it receives a SIGHUP signal, the ctld reloads its configuration and applies the changes to the kernel. Changes are applied in a way that avoids unnecessary disruptions; for example removing one LUN does not af- fect other LUNs." https://www.freebsd.org/cgi/man.cgi?query=ctld&sektion=8

We need a massive tests on FreeBSD OS. To test: Install the plugin on proxmox with the instructions.

After, create a subvol on freebsd is you want ctld running before proxmox create the first disk (i use to test connection before production).

zfs create -o compress=on -o volblocksize=64k zroot/teste

This subvol is just to point on LUN 0. You can ignore if you want.

ctl.conf example: /etc/ctl.conf portal-group portal1 { discovery-auth-group no-authentication listen 192.168.7.28 } target iqn.teste.v2a:svrteste {

SSD

 auth-group no-authentication

 lun 0 {
       path /dev/zvol/zroot/teste
 }
 portal-group portal1

}

Now on Proxmox:

/etc/pve/storage.cfg: zfs: BSD blocksize 4k iscsiprovider ctld pool zroot portal 192.168.7.28 target iqn.teste.v2a:svrteste content images lio_tpg portal1 nowritecache 1 sparse 0

PS: respect the spaces on this file. Is very important one line down above the last line. The portal1 is the reference in proxmox and ctld.conf. The luns will be created on this portal-group.