Hi and hello, I have a problem confusing me. I hope someone can help me with it. I followed a "best practise" - I think - using dedicated zfs filesystems for my virtual machines. Commands (for completion): [i]zfs create rpool/vms[/i] [i]zfs create rpool/vms/vm1[/i] [i] zfs create -V 10G rpool/vms/vm1/vm1-dsk[/i] This command creates the file system [i]/rpool/vms/vm1/vm1-dsk[/i] and the according [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i]. If I delete a VM i set up using this filesystem via[i] virsh undefine vm1[/i] the [i]/rpool/vms/vm1/vm1-dsk[/i] gets also deleted, but the [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] is left. Without [i]/rpool/vms/vm1/vm1-dsk[/i] I am not able to do [i]zfs destroy rpool/vms/vm1/vm1-dsk[/i] so the [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] could not be destroyed "and will be left forever"!? How can I get rid of this problem? -- This message posted from opensolaris.org
On Tue, Nov 03, 2009 at 11:39:28AM -0800, Ralf Teckelmann wrote:> Hi and hello, > > I have a problem confusing me. I hope someone can help me with it. > I followed a "best practise" - I think - using dedicated zfs filesystems for my virtual machines. > Commands (for completion): > [i]zfs create rpool/vms[/i] > [i]zfs create rpool/vms/vm1[/i] > [i] zfs create -V 10G rpool/vms/vm1/vm1-dsk[/i] > > This command creates the file system [i]/rpool/vms/vm1/vm1-dsk[/i] and the according [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i]. >(Clarification) Your commands create two filesystems: rpool/vms rpool/vms/vm1 You then create a ZFS Volume: rpool/vms/vm1/vm1-dsk which results in associated dsk and rdsk devices being created as: /dev/zvol/dsk/rpool/vms/vm1/vm1-dsk /dev/zvol/rdsk/rpool/vms/vm1/vm1-dsk These two nodes are artifacts of the zfs volume implementation and are required to allow zfs volumes to emulate traditional disk devices. They will appear and disappear accordingly as zfs volumes are created and destroyed.> If I delete a VM i set up using this filesystem via[i] virsh undefine vm1[/i] the [i]/rpool/vms/vm1/vm1-dsk[/i] gets also deleted, but the [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] is left. >virsh undefine does not delete filesystems, disks or any other kind of backing storage. In order to delete the three things you created, you need to issue: zfs destroy rpool/vms/vm1/vm1-dsk zfs destroy rpool/vms/vm1 zfs destroy rpool/vms or (more simply) you can do it recursively, if there''s nothing else to be affected: zfs destroy -r rpool/vms Obviously you need to be careful with recursive destruction that no other filesystems/volumes are affected.> Without [i]/rpool/vms/vm1/vm1-dsk[/i] I am not able to do [i]zfs destroy rpool/vms/vm1/vm1-dsk[/i] so the [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] could not be destroyed "and will be left forever"!? > > How can I get rid of this problem?You don''t have a problem. When the zfs volume is destroyed (as I describe above), then the associated devices are also removed.> -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discussHope that helps. Gary -- Gary Pennington Solaris Core OS Sun Microsystems Gary.Pennington at sun.com
Good Evening, Thanks for your fast reply Gary. I think I didn''t get the point in the right way so heres the second try :-)> On Tue, Nov 03, 2009 at 11:39:28AM -0800, Ralf > Teckelmann wrote: > > Hi and hello, > > > > I have a problem confusing me. I hope someone can > help me with it. > > I followed a "best practise" - I think - using > dedicated zfs filesystems for my virtual machines. > > Commands (for completion): > > [i]zfs create rpool/vms[/i] > > [i]zfs create rpool/vms/vm1[/i] > > [i] zfs create -V 10G rpool/vms/vm1/vm1-dsk[/i] > > > > This command creates the file system > [i]/rpool/vms/vm1/vm1-dsk[/i] and the according > [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i]. > > > > (Clarification) > > Your commands create two filesystems: > > rpool/vms > rpool/vms/vm1 > > You then create a ZFS Volume: > > rpool/vms/vm1/vm1-dsk > > which results in associated dsk and rdsk devices > being created as: > > /dev/zvol/dsk/rpool/vms/vm1/vm1-dsk > /dev/zvol/rdsk/rpool/vms/vm1/vm1-dsk > > These two nodes are artifacts of the zfs volume > implementation and are required > to allow zfs volumes to emulate traditional disk > devices. They will appear > and disappear accordingly as zfs volumes are created > and destroyed. >Thanks for this information.> > If I delete a VM i set up using this filesystem > via[i] virsh undefine vm1[/i] the > [i]/rpool/vms/vm1/vm1-dsk[/i] gets also deleted, but > the [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] is > left. > > > > virsh undefine does not delete filesystems, disks or > any other kind of > backing storage. In order to delete the three things > you created, you need > to issue: > > zfs destroy rpool/vms/vm1/vm1-dsk > zfs destroy rpool/vms/vm1 > zfs destroy rpool/vmsSo here comes the second try: If I remove a VM with "virsh undefine vm1" the directory /rpool/vms/vm1/ representing the filesystem above the filesystem /rpool/vms/vm1/vm1-dsk is removed and the path /rpool/vms/vm1/vm1-dsk isn''t existing anymore. So I can''t do "zfs destroy rpool/vms/vm1/vm1-dsk" nore "zfs destroy rpool/vms/vm1". Considering virsh does not remove filesystems the filesystem "/rpool/vms/vm1/vm1-dsk" must be there anyway as well as the path does not exist anymore. And the fact that the 2 nodes you described above is a argument furthermore, but I don''t have a path. Am I completly messing around? I am new in Opensolaris and zfs and quite confused. I hope I am not too confusing for you.> > or (more simply) you can do it recursively, if > there''s nothing else to be > affected: > > zfs destroy -r rpool/vms > > Obviously you need to be careful with recursive > destruction that no other > filesystems/volumes are affected. > > > Without [i]/rpool/vms/vm1/vm1-dsk[/i] I am not able > to do [i]zfs destroy rpool/vms/vm1/vm1-dsk[/i] so the > [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] could not > be destroyed "and will be left forever"!? > > > > How can I get rid of this problem? > > You don''t have a problem. When the zfs volume is > destroyed (as I describe > above), then the associated devices are also removed. >As i thought, great.> > -- > > This message posted from opensolaris.org > > _______________________________________________ > > zfs-discuss mailing list > > zfs-discuss at opensolaris.org > > > http://mail.opensolaris.org/mailman/listinfo/zfs-discu > ss > > Hope that helps. > > Gary > -- > Gary Pennington > Solaris Core OS > Sun Microsystems > Gary.Pennington at sun.com > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discu > ss-- This message posted from opensolaris.org
On Thu, Nov 05, 2009 at 10:37:28AM -0800, Ralf Teckelmann wrote:> Good Evening, > > Thanks for your fast reply Gary. I think I didn''t get the point in the right way so heres the second try :-) > > > On Tue, Nov 03, 2009 at 11:39:28AM -0800, Ralf > > Teckelmann wrote: > > > Hi and hello, > > > > > > I have a problem confusing me. I hope someone can > > help me with it. > > > I followed a "best practise" - I think - using > > dedicated zfs filesystems for my virtual machines. > > > Commands (for completion): > > > [i]zfs create rpool/vms[/i] > > > [i]zfs create rpool/vms/vm1[/i] > > > [i] zfs create -V 10G rpool/vms/vm1/vm1-dsk[/i] > > > > > > This command creates the file system > > [i]/rpool/vms/vm1/vm1-dsk[/i] and the according > > [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i]. > > > > > > > (Clarification) > > > > Your commands create two filesystems: > > > > rpool/vms > > rpool/vms/vm1 > > > > You then create a ZFS Volume: > > > > rpool/vms/vm1/vm1-dsk > > > > which results in associated dsk and rdsk devices > > being created as: > > > > /dev/zvol/dsk/rpool/vms/vm1/vm1-dsk > > /dev/zvol/rdsk/rpool/vms/vm1/vm1-dsk > > > > These two nodes are artifacts of the zfs volume > > implementation and are required > > to allow zfs volumes to emulate traditional disk > > devices. They will appear > > and disappear accordingly as zfs volumes are created > > and destroyed. > > > Thanks for this information. > > > > If I delete a VM i set up using this filesystem > > via[i] virsh undefine vm1[/i] the > > [i]/rpool/vms/vm1/vm1-dsk[/i] gets also deleted, but > > the [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] is > > left. > > > > > > > virsh undefine does not delete filesystems, disks or > > any other kind of > > backing storage. In order to delete the three things > > you created, you need > > to issue: > > > > zfs destroy rpool/vms/vm1/vm1-dsk > > zfs destroy rpool/vms/vm1 > > zfs destroy rpool/vms > > So here comes the second try: > > If I remove a VM with "virsh undefine vm1" the directory /rpool/vms/vm1/ representing the filesystem above the filesystem /rpool/vms/vm1/vm1-dsk is removed and the path /rpool/vms/vm1/vm1-dsk isn''t existing anymore. So I can''t do "zfs destroy rpool/vms/vm1/vm1-dsk" nore "zfs destroy rpool/vms/vm1"."virsh undefine vm1" doesn''t remove any of the backing storage associated with the guest. It removes the definition of the guest, but definitely not the backing storage. So, /rpool/vms/vm1/vm-dsk must still exist. Have you checked that it is being removed? If it is being removed, then something else is removing it, not virsh. You can prove this to yourself. Do the following: Run the zfs list command to list all zfs datasets e.g.: zfs list This should contain the filesystem you are interested in. Now run undefine: e.g.: virsh undefine vm1 Now run zfs list again: e.g.: zfs list You will see that your filesystem is still present and you will be able to destroy it using zfs destroy.> Considering virsh does not remove filesystems the filesystem "/rpool/vms/vm1/vm1-dsk" must be there anyway as well as the path does not exist anymore. And the fact that the 2 nodes you described above is a argument furthermore, but I don''t have a path. > > Am I completly messing around? I am new in Opensolaris and zfs and quite confused. I hope I am not too confusing for you. >I think there is some confusion, but hopefully it is clear that the virsh command doesn''t remove storage. Gary> > > > or (more simply) you can do it recursively, if > > there''s nothing else to be > > affected: > > > > zfs destroy -r rpool/vms > > > > Obviously you need to be careful with recursive > > destruction that no other > > filesystems/volumes are affected. > > > > > Without [i]/rpool/vms/vm1/vm1-dsk[/i] I am not able > > to do [i]zfs destroy rpool/vms/vm1/vm1-dsk[/i] so the > > [i]/dev/zvol/dsk/rpool/vms/vm1/vm1-dsk[/i] could not > > be destroyed "and will be left forever"!? > > > > > > How can I get rid of this problem? > > > > You don''t have a problem. When the zfs volume is > > destroyed (as I describe > > above), then the associated devices are also removed. > > > As i thought, great. > > > -- > > > This message posted from opensolaris.org > > > _______________________________________________ > > > zfs-discuss mailing list > > > zfs-discuss at opensolaris.org > > > > > http://mail.opensolaris.org/mailman/listinfo/zfs-discu > > ss > > > > Hope that helps. > > > > Gary > > -- > > Gary Pennington > > Solaris Core OS > > Sun Microsystems > > Gary.Pennington at sun.com > > _______________________________________________ > > zfs-discuss mailing list > > zfs-discuss at opensolaris.org > > http://mail.opensolaris.org/mailman/listinfo/zfs-discu > > ss > -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-- Gary Pennington Solaris Core OS Sun Microsystems Gary.Pennington at sun.com