My host servers have lots of local storage: 6 x 1TB disks.  I want to use
that local storage, so I have local storage configured "on" for non-system
VMs.

But when I add a host to CloudStack management, it configures one local
storage pool on that host, located under /var/lib/virt/images in the "/var"
volume -- and on my systems /var is only 8GB in size!  So I need to
configure 6 new local storage pools per host, one for each disk.

Neither the GUI nor the API seem to support adding local storage pools:

   - In the GUI, under Infrastructure > Primary Storage > +Add Primary
   Storage > Protocol, there are only shared storage protocols allowed (NFS,
   SharedMountPoint, RBD, and CLVM).
   - In the API, CloudMonkey and the API docs, under "create storagepool"
   the allowed arguments are only zoneid/podid/clusterid, name, "details", and
   url, which do not seem to allow for local storage either.

THIS CAN BE DONE: (hack alert)

I went to a lower level and looked at libvirt and virsh on the host server.
 I was able to use virsh to analyze the existing storage pools and create
the needed new "dir"-type local storage pools on the host (details
available if desired), but the pool did not get registered in CloudStack
although I restarted the agent and then the manager.  Still, I was able to
substitute one of the new 1TB volumes for the original cloudstack-defined 8GB
volume by the following gross hack:

a) record the UUID of the cloudstack-defined volume
b) put the host in maintenance mode and stop the cloudstack-agent
c) virsh pool-destroy both its volume and my volume locally on the host
d) virsh pool-create a new volume in the 1TB location with the
cloudstack-defined UUID and name
e) restart the cloudstack-agent and take the host out of maintenance mode


It popped an exception in the logs and an error in the web app, but
successfully finished taking the host out of maintenance mode.  This host
is now happily hosting CloudStack VM instances with big local-store Root
volumes.

So, there must be a way to use MySQL to edit the database and insert these
additional local storage pools into the system (and take out the /var pools
that are too small to do any good).  Would someone please tell me what to
put where, so I don't have to reverse engineer the many storage-related
database tables?

I'm using CloudStack 4.1.0 over CentOS 6.3 with KVM.

Thanks, greatly appreciate any help,
--Matt

Reply via email to