[pve-devel] FreeNAS plugin: Status

Michael Rasmussen mir at datanom.net
Wed Jun 7 22:41:08 CEST 2017


On Wed, 7 Jun 2017 18:57:42 +0200
Michael Rasmussen <mir at datanom.net> wrote:

> When CT is online:
> mount.nfs: Failed to resolve server /dev/disk/by-path/ip-10.0.1.32: Name or service not known
> Failed to update the container's filesystem: command 'unshare -m -- sh -c 'mount --make-rprivate / && mount /dev/disk/by-path/ip-10.0.1.32:3260-iscsi-iqn.2005-10.org.freenas.ctl:vm-103-lun-0 /tmp && resize2fs /dev/disk/by-path/ip-10.0.1.32:3260-iscsi-iqn.2005-10.org.freenas.ctl:vm-103-lun-0'' failed: exit code 32
> 
> Should I bail when resize is called on a running CT?
> 
It is this part (/usr/share/perl5/PVE/API2/LXC.pm:1455):
if ($format eq 'raw') {
	my $path = PVE::Storage::path($storage_cfg, $volid, undef);
	if ($running) {

		$mp->{mp} = '/';
		my $use_loopdev = (PVE::LXC::mountpoint_mount_path($mp, $storage_cfg))[1];
		$path = PVE::LXC::query_loopdev($path) if $use_loopdev;
		die "internal error: CT running but mount point not attached to a loop device"
			if !$path;
		PVE::Tools::run_command(['losetup', '--set-capacity', $path]) if $use_loopdev;

		# In order for resize2fs to know that we need online-resizing a mountpoint needs
		# to be visible to it in its namespace.
		# To not interfere with the rest of the system we unshare the current mount namespace,
		# mount over /tmp and then run resize2fs.

		# interestingly we don't need to e2fsck on mounted systems...
		my $quoted = PVE::Tools::shellquote($path);
		my $cmd = "mount --make-rprivate / && mount $quoted /tmp && resize2fs $quoted";
		eval {
			PVE::Tools::run_command(['unshare', '-m', '--', 'sh', '-c', $cmd]);
		};
		warn "Failed to update the container's filesystem: $@\n" if $@;
	} else {
		eval {
			PVE::Tools::run_command(['e2fsck', '-f', '-y', $path]);
			PVE::Tools::run_command(['resize2fs', $path]);
		};
		warn "Failed to update the container's filesystem: $@\n" if $@;
	}
}
Which brakes. 
If I run the command (unshare -m -- sh -c 'mount --make-rprivate / &&
mount /dev/disk/by-path/ip-10.0.1.32:3260-iscsi-iqn.2005-10.org.freenas.ctl:vm-103-lun-0 /tmp &&
resize2fs /dev/disk/by-path/ip-10.0.1.32:3260-iscsi-iqn.2005-10.org.freenas.ctl:vm-103-lun-0')
from the command line everything works as expected so I think what is
causing the brake is this mysterious log 'mount.nfs: Failed to resolve
server /dev/disk/by-path/ip-10.0.1.32: Name or service not known' which I don't understand and cannot find out why a mount.nfs is done and from where it is executed?

-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
/usr/games/fortune -es says:
Debian Hint #19: If you're interested in building packages from source,
you should consider installing the apt-src package.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20170607/b9973704/attachment.sig>


More information about the pve-devel mailing list