[libvirt] [RFC] Usage about 'virsh vol-wipe vol_name'

Hi all, I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one. However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish? -- Thanks Harry Wei

On Fri, Apr 12, 2013 at 10:22 AM, harryxiyou <harryxiyou@gmail.com> wrote:
Hi all,
I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one.
After i read the back-end storage drivers for libvirt, i cannot find any storage driver like following 128 VIR_STORAGE_POOL_DIR, /* Local directory */ 129 VIR_STORAGE_POOL_FS, /* Local filesystem */ 130 VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */ 131 VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */ 132 VIR_STORAGE_POOL_DISK, /* Disk partitions */ 133 VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ 134 VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ 135 VIR_STORAGE_POOL_MPATH, /* Multipath devices */ 136 VIR_STORAGE_POOL_RBD, /* RADOS Block Device */ 137 VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */ has realized storageVolumeWipe feature. So how could we test this feature? Could anyone please give me some suggestions? Thanks in advance.
However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish?
-- Thanks Harry Wei
-- Thanks Harry Wei

On 12/04/13 11:16, harryxiyou wrote:
On Fri, Apr 12, 2013 at 10:22 AM, harryxiyou <harryxiyou@gmail.com> wrote:
Hi all,
I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one. After i read the back-end storage drivers for libvirt, i cannot find any storage driver like following
128 VIR_STORAGE_POOL_DIR, /* Local directory */ 129 VIR_STORAGE_POOL_FS, /* Local filesystem */ 130 VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */ 131 VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */ 132 VIR_STORAGE_POOL_DISK, /* Disk partitions */ 133 VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ 134 VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ 135 VIR_STORAGE_POOL_MPATH, /* Multipath devices */ 136 VIR_STORAGE_POOL_RBD, /* RADOS Block Device */ 137 VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */
has realized storageVolumeWipe feature. So how could we test this feature?
Could anyone please give me some suggestions? Thanks in advance.
As Michal suggested in your previous mails, you *should* use cscope. If you looked at the public API, and using cscope like: cs find s volWipe You will find where it's implemented.
However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish?
-- Thanks Harry Wei
-- Thanks Harry Wei

On 12/04/13 11:16, harryxiyou wrote:
On Fri, Apr 12, 2013 at 10:22 AM, harryxiyou <harryxiyou@gmail.com> wrote:
Hi all,
I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one. After i read the back-end storage drivers for libvirt, i cannot find any storage driver like following
128 VIR_STORAGE_POOL_DIR, /* Local directory */ 129 VIR_STORAGE_POOL_FS, /* Local filesystem */ 130 VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */ 131 VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */ 132 VIR_STORAGE_POOL_DISK, /* Disk partitions */ 133 VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ 134 VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ 135 VIR_STORAGE_POOL_MPATH, /* Multipath devices */ 136 VIR_STORAGE_POOL_RBD, /* RADOS Block Device */ 137 VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */
has realized storageVolumeWipe feature. So how could we test this feature?
The command is there, and the docs is there too. So you already had the guide, why not to try it?
Could anyone please give me some suggestions? Thanks in advance.
However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish?
I didn't try, but I think vol-upload can do the work, though it's not that straightforward. And I think having an API to wipe part of volume data explicitly can be useful, it can be acheived, though I'm not sure if scrub support to wipe part of the data, for a normal wiping without the scrub's algrithoms, it's already implemented by helper storageWipeExtent, and can be easily exposed as a public API.
-- Thanks Harry Wei
-- Thanks Harry Wei

On Fri, Apr 12, 2013 at 12:39 PM, Osier Yang <jyang@redhat.com> wrote: [...]
The command is there, and the docs is there too. So you already had the guide, why not to try it?
Thanks, i will.
Could anyone please give me some suggestions? Thanks in advance.
However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish?
I didn't try, but I think vol-upload can do the work, though it's not that straightforward. And I think having an API to wipe part of volume data explicitly can be useful, it can be acheived, though I'm not sure if scrub support to wipe part of the data, for a normal wiping without the scrub's algrithoms, it's already implemented by helper storageWipeExtent, and can be easily exposed as a public API.
Maybe this is deserved for us to achieve ;-) -- Thanks Harry Wei

On 12/04/13 11:16, harryxiyou wrote:
On Fri, Apr 12, 2013 at 10:22 AM, harryxiyou <harryxiyou@gmail.com> wrote:
Hi all,
I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one. After i read the back-end storage drivers for libvirt, i cannot find any storage driver like following
128 VIR_STORAGE_POOL_DIR, /* Local directory */ 129 VIR_STORAGE_POOL_FS, /* Local filesystem */ 130 VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */ 131 VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */ 132 VIR_STORAGE_POOL_DISK, /* Disk partitions */ 133 VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ 134 VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ 135 VIR_STORAGE_POOL_MPATH, /* Multipath devices */ 136 VIR_STORAGE_POOL_RBD, /* RADOS Block Device */ 137 VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */
has realized storageVolumeWipe feature. So how could we test this feature?
As Michal suggested in your previous mail, cscope is a good choice for you to learn libvirt. E.g. If you looked at the public API for volWipe in src/libvirt.c, and using cscope like: cs find s volWipe You will get where it's implemented.
Could anyone please give me some suggestions? Thanks in advance.
However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish?
-- Thanks Harry Wei
-- Thanks Harry Wei

On Fri, Apr 12, 2013 at 12:42 PM, Osier Yang <jyang@redhat.com> wrote: Hi Osier,
On Fri, Apr 12, 2013 at 10:22 AM, harryxiyou <harryxiyou@gmail.com> wrote:
Hi all,
I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one.
After i read the back-end storage drivers for libvirt, i cannot find any storage driver like following
128 VIR_STORAGE_POOL_DIR, /* Local directory */ 129 VIR_STORAGE_POOL_FS, /* Local filesystem */ 130 VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */ 131 VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */ 132 VIR_STORAGE_POOL_DISK, /* Disk partitions */ 133 VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ 134 VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ 135 VIR_STORAGE_POOL_MPATH, /* Multipath devices */ 136 VIR_STORAGE_POOL_RBD, /* RADOS Block Device */ 137 VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */
has realized storageVolumeWipe feature. So how could we test this feature?
As Michal suggested in your previous mail, cscope is a good choice for you to learn libvirt. E.g. If you looked at the public API for volWipe in src/libvirt.c, and using cscope like:
cs find s volWipe
You will get where it's implemented.
Actually, i can find volWipe itself. Let me find deeply. -- Thanks Harry Wei

On Fri, Apr 12, 2013 at 10:22 AM, harryxiyou <harryxiyou@gmail.com> wrote:
Hi all,
I am not very clear about the usage of ‘virsh vol-wipe vol_name’. I think if 'virsh vol-wipe vol_name' can just wipe all the datas in this volume and it is similar as we format a volume which the datas would be wiped, right? After this wipe, we can use this volume like a new one.
After i read the back-end storage drivers for libvirt, i cannot find any storage driver like following 128 VIR_STORAGE_POOL_DIR, /* Local directory */ 129 VIR_STORAGE_POOL_FS, /* Local filesystem */ 130 VIR_STORAGE_POOL_NETFS, /* Networked filesystem - eg NFS, GFS, etc */ 131 VIR_STORAGE_POOL_LOGICAL, /* Logical volume groups / volumes */ 132 VIR_STORAGE_POOL_DISK, /* Disk partitions */ 133 VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ 134 VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ 135 VIR_STORAGE_POOL_MPATH, /* Multipath devices */ 136 VIR_STORAGE_POOL_RBD, /* RADOS Block Device */ 137 VIR_STORAGE_POOL_SHEEPDOG, /* Sheepdog device */ has realized storageVolumeWipe feature. So how could we test this feature? Could anyone please give me some suggestions? Thanks in advance.
However, if users just want to wipe portions data of this volume, which command(interface) of libvirt could finish?
-- Thanks Harry Wei
-- Thanks Harry Wei
participants (2)
-
harryxiyou
-
Osier Yang