TheGrandWazoo / freenas-proxmox

ZFS over iSCSI to FreeNAS API's from Proxmox VE
MIT License
236 stars 42 forks source link

Unable to connect to the FreeNAS API service #135

Closed Grunticus03 closed 1 year ago

Grunticus03 commented 1 year ago

Running Proxmox 7.4-3 and TrueNAS-13.0-U4. When attempting to create a VM, I receive the following error:

TASK ERROR: unable to create VM 120 - Unable to connect to the FreeNAS API service at '10.1.0.252' using the 'http' protocol at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 380.

This is a new install. I followed the instructions provided on the main github page and then ran the following commands to generate SSH keys.

mkdir /etc/pve/priv/zfs
ssh-keygen -f /etc/pve/priv/zfs/10.1.0.252_id_rsa
ssh-copy-id -i /etc/pve/priv/zfs/10.1.0.252_id_rsa.pub root@10.1.0.252

After which, I verified I could ssh from my proxmox hosts into TrueNAS. I created storage using ZFS over iSCSI:

image

My Proxmox nodes seem to connect and show the storage is active.

Grunticus03 commented 1 year ago

I just noticed that Proxmox is showing VM Disks under this storage option, but I can't remove them.

Unable to connect to the FreeNAS API service at '10.1.0.252' using the 'http' protocol at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 380. (500)

I'm unsure of how to check TrueNAS to see if they're really there, I don't see any extents created.

I also tried to create a disk on an existing VM and received a little more output

update VM 120: -scsi1 TrueNAS:32,iothread=on
Warning: volblocksize (4096) is less than the default minimum block size (8192).
To reduce wasted space a volblocksize of 8192 is recommended.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 597.
Use of uninitialized value $target_id in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 787.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 618.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 597.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 597.
Use of uninitialized value $target_id in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 787.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 597.
Use of uninitialized value $target_id in concatenation (.) or string at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 787.
TASK ERROR: Unable to find the target id for iqn.2005-10.org.freenas.ctl:vmpool at /usr/share/perl5/PVE/Storage/LunCmd/FreeNAS.pm line 259.

EDIT: I checked my storage pool in TrueNAS and I see the volumes were created, so something is working...

Grunticus03 commented 1 year ago

My issue was ridiculous...after lots of testing and fiddling around, I figured out that Proxmox was connecting to TrueNAS over SSH and running the appropriate commands successfully. Afterwards, it connects to the API over 80/443 to perform additional functions. The API listens on the same interfaces that the WebGUI is configured to listen on. On TrueNAS, going to System>General and adding my storage network to the Web Interface IPv4 address, everything started working properly.