ahmadqz
(Ahmad Alzoubi)
February 23, 2023, 1:17am
3
I had the same question, and with some search, I understand that currently there is no way to make the creation of new storage volumes automated through the profiles or any other way in LXD (I do not know if we can do it using Ansible). The storage volume should be created first and then attached to the instance. You can see the other questions:
I’d like to add an additional storage pool (beyond the root device) to a profile that gets mounted at a specific mount point within the container, that keeps each container’s data separate within the additional pool.
To get more specific, the container’s rootfs is in a ceph pool, which is fine for the base system, but there is some highly volitile data that I woud prefer to keep local to the host. So I added an additional dir pool that I’d like to present in an unshared, per-container mount poi…
Currently I am manually creating and attaching storage volumes. I am using them to experiment with ceph block io.
How can I do the equivalent to this bash script but in a profile?
Can I set the volume to auto delete when the instance deletes via the profile as well?
#!/bin/bash
VMS="v1 v2 v3"
DISKS="data1 data2 data3"
readonly DATA_DISK="100GiB"
for VM in $VMS
do
for DISK in $DISKS
do
lxc storage volume create default "${VM}-${DISK}" --type block size=${DATA_DISK}
…
Hello,
I want to boot a couple of VMs to use as a cluster and I am having issues with the storage.
I want my VMs to have custom disk size (ex. 100GB) on a specific path. I finally found out my image needs to have cloud-init for the storage to be customizable. So I create my VMs with the following command:
lxc launch images:ubuntu/22.04/cloud test --vm
The end result is the following:
$ lxc exec test – df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 2.8G 796K 2.…