Change ZFS device names

Discussion in 'Proxmox VE: Installation and configuration' started by Mrt12, May 19, 2019.

Tags:
  1. Mrt12

    Mrt12 New Member

    Joined:
    May 19, 2019
    Messages:
    3
    Likes Received:
    0
    I created a zpool where I used the disk ID names from
    Code:
    /dev/disk/by-id
    . This works fine, however I recently read about the vdev_id.conf file. I created my own
    Code:
    vdev_id.conf
    where I could create disk aliases for the slots where the disks are in, so I have my disks now accessible through
    Code:
    /dev/disk/by-vdev/slot0
    and so on. This is very convenient, because with the ID notation it can become difficult to find out in which slot a specific disk is, but with the vdev file it is much easier.
    So I would like to change my zpool to use my own device names. I read that this is possible with
    Code:
    zpool export tank
    followed by
    Code:
    zpool import tank -d /dev/disk/by-vdev
    So I tried to do that. But when I exported my zpool called "tank", it appeared that Proxmox immediately re-imported it. Because when I tried to use "zpool import", the pool was already imported, still using the old disk names.
    I have a few containers, having their disks as subvolumes in my tank, and I also have the VM images in a Proxmox storage, also on that tank. Of course I had the VMs and containers stopped before I did the export!

    So what is the right way to export a zpool in such a configuration?

    Do I need to stop some Proxmox services before I can proceed? It looks like someone automatically imports my pool after I have exported it, without my interaction. On one hand this is awesome, but in this particular situation it is not so handy.
     
  2. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    3,519
    Likes Received:
    318
    you want to disable the storage to prevent an automatic import
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Mrt12

    Mrt12 New Member

    Joined:
    May 19, 2019
    Messages:
    3
    Likes Received:
    0
    can I temporarily do that without affecting my existing VMs?
    I assume you are talking about the storage in the "Datacenter".

    So the steps would be
    a) disable storage
    b) zpool export tank
    c) zpool import tank -d /dev/disk/by-vdev
    right?

    I just tested following:

    zpool export tank && zpool import tank -d /dev/disk/by-vdev/

    and for just one second I saw the device names from my vdev_id.conf, but then it reverted to the old disk/by-id names. Why is that?
     
  4. dcsapak

    dcsapak Proxmox Staff Member
    Staff Member

    Joined:
    Feb 1, 2016
    Messages:
    3,519
    Likes Received:
    318
    mhmm... works here without problems:

    1. disabled storage in datacenter->storage
    2. edited vdev_id.conf (in my example a single device with alias d1 /dev/disk/by-id/ww......)
    3. zpool export mytestzfs && zpool import -d /dev/disk/by-vdev mytestzfs
    4. zpool status shows:
    Code:
    ...
    mytestzfs ONLINE
      d1      ONLINE
    ...
    
    5. reenabled storage
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Ryan Anderson likes this.
  5. Mrt12

    Mrt12 New Member

    Joined:
    May 19, 2019
    Messages:
    3
    Likes Received:
    0
    HA! temporarily disabling the storage helped a lot. With that it worked like a charm and stays permanent, even survives a reboot - as intended. Thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice