Usually in oVirt you are want your VMs to be on a shared storage, so they can live migrate between the hosts.
On Sun, Nov 28, 2021 at 16:23, Nir Soffer<nsoffer@redhat.com> wrote:On Sun, Nov 28, 2021 at 2:06 PM <th3penguinwhisperer@gmail.com> wrote:
>
> Thanks for your reply. Greatly appreciated.
>
> > The oVirt way is to create a block storage domain, and create a raw
> > preallocated disk.
> > This will attach a logical volume to the VM.
>
> Problem is that I already have an existing LV that was used before.
> But I guess if I mount that LV on the host I could copy all the data over through scp or similar to the VM with the newly created LV (which requires me to have double the disk space).
>
> Do I understand correctly that a designated VG is used and LVs are created in it and those are exposed as iSCSI volumes and mounted as such in the guest OS?
>
No. It works like this:
1. You configure iSCSI server (e.g. using targetcli), and export one
or more LUNs.
2. You create a iSCSI storage domain in oVirt, connecting to your iSCSI target
3. You select the LUN(s) that should be part of this storage domain
4. oVirt creates a VG with the specified LUN(s)
5. oVirt creates special logical volumes for management (~5G)
6. You create a new disk in oVirt on this storage domain
to use the same raw lv as you used before, use "allocation policy:
preallocated"
7. oVirt creates a logical volume in the VG
So if you want to use existing LV content, you need to create the disk
in oVirt, and then
you can copy the logical volume from the original LV to the new disk:
You need to find the logical volume created for the VM disk, can be done using:
lvs -o lv_name,tags storage-domain-id | grep disk-id
Then you need to active both lvs, and copy the image:
lvchange -ay old-vg/old-lv
lvchange -ay storage-domain-id/lv-name
qemu-img convert -p -f raw -O raw -t none -T none -n -W
/dev/old-vg/olv-lv dev/storage-domain-id/lv-name
lvchange -an old-vg/old-lv
lvchange -an storage-domain-id/lv-name
> The disk space is already allocated to VolumeGroups so I'd have to fiddle to be able to get an extra VG for that storage domain unless I add a disk.
Note that the iSCSI storage domain must be accessible to all hosts in
the data center.
If not you will not be able to activate all the hosts.
Keeping the storage on one of the hypervisors is possible but not recommended.
> I prefer to keep it simple. Perhaps I should create an NFS share and mount that in the guest but then again I'm not that fond of putting it on an NFS share.
>
> >
> > The difference is that the logical volume is served by iSCSI or FC
> > storage server,
> > and you can migrate the VM between hosts.
> >
> > If you really want to use local host storage, the best way is to
> > create a local DC
> > that will include only this host, and use raw preallocated file on the
> > local storage
> > domain.
>
> That would kind of defeat the purpose for me. With the setup I had I could directly mount the LV on the host.
> Perhaps I misunderstand what you're saying here.
oVirt does not support attaching LVs or a local file directly to VMs.
You can also continue to use libvirt and qemu to manage this VM. oVirt
will see it as
external VM running on the host, and it should not try to manage it.
The feature you need, attach logical volume to a VM does not exist, so you
need to either use what the system provides, or manage the VM outside
of the system.
Nirhttps://lists.ovirt.org/archives/list/users@ovirt.org/message/VZGX6VBATSBPIHLGVI5LCTAFIXYMMHJ5/
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: