You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Travis Graham <t...@tgraham.us> on 2013/08/29 16:23:06 UTC

Change default libvirt storage pool location on KVM

When I add a new KVM host to a cluster it sets up a default Primary storage that's pointing to the /var/lib/libvirt/images/ directory on the KVM host. I've dug around trying to find where to change that default but I'm not see where it's being configured.

I've tried to change the local_path values in the storage_pool and storage_pool_host_ref tables, but I keep getting errors when trying to spin up the systemvms.

Is this something that is configured through cloudstack somewhere or something I need to change in libvirt when configuring a new KVM host and where/how would I change that? The libvirt docs show some XML files that describe how that's setup and that /var/lib/libvirt/images/ is the default, but doesn't explain where/how to change that.

Thanks,
Travis

Re: Change default libvirt storage pool location on KVM

Posted by Ove Ewerlid <Ov...@oracle.com>.
Until you figure this out, you can use bind mount to bind 
/var/lib/libvirt/images to a larger local directory. Lines such as this 
would exist in /etc/fstab;

  /data1/var/lib/libvirt/images   /var/lib/libvirt/images  none bind 0 0

ignore if you are already using this method and need to other method to 
meet your requirements.

/Ove

On 08/29/2013 04:23 PM, Travis Graham wrote:
> When I add a new KVM host to a cluster it sets up a default Primary storage that's pointing to the /var/lib/libvirt/images/ directory on the KVM host. I've dug around trying to find where to change that default but I'm not see where it's being configured.
>
> I've tried to change the local_path values in the storage_pool and storage_pool_host_ref tables, but I keep getting errors when trying to spin up the systemvms.
>
> Is this something that is configured through cloudstack somewhere or something I need to change in libvirt when configuring a new KVM host and where/how would I change that? The libvirt docs show some XML files that describe how that's setup and that /var/lib/libvirt/images/ is the default, but doesn't explain where/how to change that.
>
> Thanks,
> Travis
>


-- 
Ove Everlid
System Administrator / Architect / SDN & Linux hacker
Mobile: +46706662363
Office: +4618656913 (note EMEA Time Zone)

RE: Change default libvirt storage pool location on KVM

Posted by David Ortiz <dp...@outlook.com>.
Fair enough.  I am running 4.0.1, so it must have been removed then.  I would restart the agent though to be safe.  Might be worth asking on the dev list as well since I would imagine someone there knows what the agent does to get its local storage path.  Let me know if you find out what the new approach is as I expect to be setting up a KVM cluster with 4.2 in the next couple months (which will hopefully be the same).  =D

> Subject: Re: Change default libvirt storage pool location on KVM
> From: tgraham@tgraham.us
> Date: Fri, 13 Sep 2013 16:12:52 -0400
> To: users@cloudstack.apache.org
> 
> Hello Dave,
> 
> I don't have a local.storage.path variable in my agent.properties file, instead I have local.storage.uuid which is set to the uuid in the storage_pool table. The path in the table is set to /var/lib/libvirt/images/ and as I mentioned earlier, I tried to change it in the db with no luck. Not sure if I should have restarted cloudstack-agent or not to pick up any settings changed in the db.
> 
> I'm using the 4.1.1 agent so I'm not sure if that property was removed since the 4.1.0 release.
> 
> Thoughts?
> 
> Travis
> 
> 
> On Sep 13, 2013, at 2:22 PM, David Ortiz <dp...@outlook.com> wrote:
> 
> > Travis,
> >     Change the property local.storage.path in /etc/cloud/agent/agent.properties.
> > Thanks,     Dave
> > 
> >> Date: Thu, 29 Aug 2013 21:03:51 +0530
> >> Subject: Re: Change default libvirt storage pool location on KVM
> >> From: rajujith@gmail.com
> >> To: users@cloudstack.apache.org
> >> 
> >> Hello Travis,
> >> 
> >> If you are using virt-manager GUI then you can select the host, in case of
> >> localhost select localhost (qemu connection) go to edit->connection details
> >> there you have storage and you should be able to delete add or whatever.
> >> If no GUI then use 'virsh' with storage pool commands.
> >> first 'virsh pool-list, then virsh pool-destroy and finally virsh
> >> pool-define with your xml config I believe.
> >> 
> >> Thanks,
> >> Jithin
> >> 
> >> 
> >> On Thu, Aug 29, 2013 at 7:53 PM, Travis Graham <t...@tgraham.us> wrote:
> >> 
> >>> When I add a new KVM host to a cluster it sets up a default Primary
> >>> storage that's pointing to the /var/lib/libvirt/images/ directory on the
> >>> KVM host. I've dug around trying to find where to change that default but
> >>> I'm not see where it's being configured.
> >>> 
> >>> I've tried to change the local_path values in the storage_pool and
> >>> storage_pool_host_ref tables, but I keep getting errors when trying to spin
> >>> up the systemvms.
> >>> 
> >>> Is this something that is configured through cloudstack somewhere or
> >>> something I need to change in libvirt when configuring a new KVM host and
> >>> where/how would I change that? The libvirt docs show some XML files that
> >>> describe how that's setup and that /var/lib/libvirt/images/ is the default,
> >>> but doesn't explain where/how to change that.
> >>> 
> >>> Thanks,
> >>> Travis
> > 		 	   		  
> 
 		 	   		  

Re: Change default libvirt storage pool location on KVM

Posted by Travis Graham <tg...@tgraham.us>.
Hello Dave,

I don't have a local.storage.path variable in my agent.properties file, instead I have local.storage.uuid which is set to the uuid in the storage_pool table. The path in the table is set to /var/lib/libvirt/images/ and as I mentioned earlier, I tried to change it in the db with no luck. Not sure if I should have restarted cloudstack-agent or not to pick up any settings changed in the db.

I'm using the 4.1.1 agent so I'm not sure if that property was removed since the 4.1.0 release.

Thoughts?

Travis


On Sep 13, 2013, at 2:22 PM, David Ortiz <dp...@outlook.com> wrote:

> Travis,
>     Change the property local.storage.path in /etc/cloud/agent/agent.properties.
> Thanks,     Dave
> 
>> Date: Thu, 29 Aug 2013 21:03:51 +0530
>> Subject: Re: Change default libvirt storage pool location on KVM
>> From: rajujith@gmail.com
>> To: users@cloudstack.apache.org
>> 
>> Hello Travis,
>> 
>> If you are using virt-manager GUI then you can select the host, in case of
>> localhost select localhost (qemu connection) go to edit->connection details
>> there you have storage and you should be able to delete add or whatever.
>> If no GUI then use 'virsh' with storage pool commands.
>> first 'virsh pool-list, then virsh pool-destroy and finally virsh
>> pool-define with your xml config I believe.
>> 
>> Thanks,
>> Jithin
>> 
>> 
>> On Thu, Aug 29, 2013 at 7:53 PM, Travis Graham <t...@tgraham.us> wrote:
>> 
>>> When I add a new KVM host to a cluster it sets up a default Primary
>>> storage that's pointing to the /var/lib/libvirt/images/ directory on the
>>> KVM host. I've dug around trying to find where to change that default but
>>> I'm not see where it's being configured.
>>> 
>>> I've tried to change the local_path values in the storage_pool and
>>> storage_pool_host_ref tables, but I keep getting errors when trying to spin
>>> up the systemvms.
>>> 
>>> Is this something that is configured through cloudstack somewhere or
>>> something I need to change in libvirt when configuring a new KVM host and
>>> where/how would I change that? The libvirt docs show some XML files that
>>> describe how that's setup and that /var/lib/libvirt/images/ is the default,
>>> but doesn't explain where/how to change that.
>>> 
>>> Thanks,
>>> Travis
> 		 	   		  


RE: Change default libvirt storage pool location on KVM

Posted by David Ortiz <dp...@outlook.com>.
Travis,
     Change the property local.storage.path in /etc/cloud/agent/agent.properties.
Thanks,     Dave

> Date: Thu, 29 Aug 2013 21:03:51 +0530
> Subject: Re: Change default libvirt storage pool location on KVM
> From: rajujith@gmail.com
> To: users@cloudstack.apache.org
> 
> Hello Travis,
> 
> If you are using virt-manager GUI then you can select the host, in case of
> localhost select localhost (qemu connection) go to edit->connection details
> there you have storage and you should be able to delete add or whatever.
> If no GUI then use 'virsh' with storage pool commands.
> first 'virsh pool-list, then virsh pool-destroy and finally virsh
> pool-define with your xml config I believe.
> 
> Thanks,
> Jithin
> 
> 
> On Thu, Aug 29, 2013 at 7:53 PM, Travis Graham <t...@tgraham.us> wrote:
> 
> > When I add a new KVM host to a cluster it sets up a default Primary
> > storage that's pointing to the /var/lib/libvirt/images/ directory on the
> > KVM host. I've dug around trying to find where to change that default but
> > I'm not see where it's being configured.
> >
> > I've tried to change the local_path values in the storage_pool and
> > storage_pool_host_ref tables, but I keep getting errors when trying to spin
> > up the systemvms.
> >
> > Is this something that is configured through cloudstack somewhere or
> > something I need to change in libvirt when configuring a new KVM host and
> > where/how would I change that? The libvirt docs show some XML files that
> > describe how that's setup and that /var/lib/libvirt/images/ is the default,
> > but doesn't explain where/how to change that.
> >
> > Thanks,
> > Travis
 		 	   		  

Re: Change default libvirt storage pool location on KVM

Posted by Jithin Raju <ra...@gmail.com>.
Hello Travis,

If you are using virt-manager GUI then you can select the host, in case of
localhost select localhost (qemu connection) go to edit->connection details
there you have storage and you should be able to delete add or whatever.
If no GUI then use 'virsh' with storage pool commands.
first 'virsh pool-list, then virsh pool-destroy and finally virsh
pool-define with your xml config I believe.

Thanks,
Jithin


On Thu, Aug 29, 2013 at 7:53 PM, Travis Graham <t...@tgraham.us> wrote:

> When I add a new KVM host to a cluster it sets up a default Primary
> storage that's pointing to the /var/lib/libvirt/images/ directory on the
> KVM host. I've dug around trying to find where to change that default but
> I'm not see where it's being configured.
>
> I've tried to change the local_path values in the storage_pool and
> storage_pool_host_ref tables, but I keep getting errors when trying to spin
> up the systemvms.
>
> Is this something that is configured through cloudstack somewhere or
> something I need to change in libvirt when configuring a new KVM host and
> where/how would I change that? The libvirt docs show some XML files that
> describe how that's setup and that /var/lib/libvirt/images/ is the default,
> but doesn't explain where/how to change that.
>
> Thanks,
> Travis