You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Noel Kendall <no...@hotmail.com> on 2013/08/13 01:27:17 UTC

Possible to place guest VM swap on local storage?

Typically, I configure primary storage onto an NFS server with a RAID1 array, and expose that zone-wide.Works fine.
However, it strikes me that it makes little sense to allow guest VMs to place their swap files there - which is thesimple model currently in place.
What I would prefer, and makes sense from a performance point of view, is to define a number of swap partitionson disk images residing on the local storage system of my KVM host.
I've been over the documentation several times and it seems that options for configuring this setup are notgranular enough: I want primary storage defined in the NFS to be the default locus for storage, while local storageto be the locus for specifically placed swap resources.
Has anybody done this, or know how this can be done?
TIA, Noel 		 	   		  

Re: Possible to place guest VM swap on local storage?

Posted by Ahmad Emneina <ae...@gmail.com>.
you can definitely have mixed zones, so that shouldn't impact current or
future shared storage deployments. you're correct in your thinking that the
service offering/disk offering is how the storage back-end is defined.


On Mon, Aug 12, 2013 at 5:24 PM, Noel Kendall <no...@hotmail.com>wrote:

> Your suggestion is exactly the process I attempted to follow, but it was
> not permitted,which is why I have come to the forum. I defined a storage
> service offering, local, of1G.
> When I try to create a data disk using that offering, the attempt fails
> with the message 'Zone is not configured to use local storage but volume's
> disk offering LocalSwap uses it'.I understand that the 'local storage'
> enabling configuration is in the zone definition, and isalterable at any
> time. I see the box in the UI to enable it.
> This leaves me a dilemma... if I configure the zone to use local storage,
> then I am uncertainof the degree of risk to which I expose the zone... does
> my next VM ROOT disk end up onlocal? Or is that taken because the VM disk
> offering will use 'shared' and this is how the placementis controlled - via
> shared/local? I want to be sure before I do this, as I have a number
> ofguests and data disks already defined and do not dare risk blowing up
> this running cloud.
> Thanks for the response!
>
> > Date: Mon, 12 Aug 2013 17:03:14 -0700
> > Subject: Re: Possible to place guest VM swap on local storage?
> > From: aemneina@gmail.com
> > To: users@cloudstack.apache.org
> >
> > What one can do is create a disk offering using local storage. Then when
> > spinning up a VM using the regular shared storage (NFS) include a data
> disk
> > that uses the local storage offering. Once the guest boots it should
> > understand that it has to use the additional disk for swap space.
> > Accomplishing this via scripts... Hope that helps.
> > On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com>
> wrote:
> >
> > > Typically, I configure primary storage onto an NFS server with a RAID1
> > > array, and expose that zone-wide.Works fine.
> > > However, it strikes me that it makes little sense to allow guest VMs to
> > > place their swap files there - which is thesimple model currently in
> place.
> > > What I would prefer, and makes sense from a performance point of view,
> is
> > > to define a number of swap partitionson disk images residing on the
> local
> > > storage system of my KVM host.
> > > I've been over the documentation several times and it seems that
> options
> > > for configuring this setup are notgranular enough: I want primary
> storage
> > > defined in the NFS to be the default locus for storage, while local
> > > storageto be the locus for specifically placed swap resources.
> > > Has anybody done this, or know how this can be done?
> > > TIA, Noel
>
>

RE: Possible to place guest VM swap on local storage?

Posted by Koushik Das <ko...@citrix.com>.

> -----Original Message-----
> From: Koushik Das [mailto:koushik.das@citrix.com]
> Sent: Tuesday, August 13, 2013 11:17 AM
> To: users@cloudstack.apache.org
> Subject: RE: Possible to place guest VM swap on local storage?
> 
> 
> > Hope this helps anyone else trying to do the same thing. The two
> > surprises in the process were the automatic creation of the primary
> > storage, and the missing configuration row in the database (bug).
> > N
> 
> When local storage setting is enabled at the zone then local primary stores
> attached to the host automatically gets discovered while adding the host. For
> already added host the discovery happens after MS is restarted.
> About the missing config, is it a new installation or an upgraded one? The
> config needs to be present in both scenarios.
> 

One clarification, the local storage config is now part of the data center/zone definition. In the database it is present in 'data_center' table and not the 'configuration' table.


> -Koushik
> 
> > > From: noeldkendall@hotmail.com
> > > To: users@cloudstack.apache.org
> > > Subject: RE: Possible to place guest VM swap on local storage?
> > > Date: Mon, 12 Aug 2013 20:24:27 -0400
> > >
> > > Your suggestion is exactly the process I attempted to follow, but it
> > > was not
> > permitted,which is why I have come to the forum. I defined a storage
> > service offering, local, of1G.
> > > When I try to create a data disk using that offering, the attempt
> > > fails with
> > the message 'Zone is not configured to use local storage but volume's
> > disk offering LocalSwap uses it'.I understand that the 'local storage'
> > enabling configuration is in the zone definition, and isalterable at
> > any time. I see the box in the UI to enable it.
> > > This leaves me a dilemma... if I configure the zone to use local
> > > storage, then
> > I am uncertainof the degree of risk to which I expose the zone... does
> > my next VM ROOT disk end up onlocal? Or is that taken because the VM
> > disk offering will use 'shared' and this is how the placementis
> > controlled - via shared/local? I want to be sure before I do this, as
> > I have a number ofguests and data disks already defined and do not
> > dare risk blowing up this running cloud.
> > > Thanks for the response!
> > >
> > > > Date: Mon, 12 Aug 2013 17:03:14 -0700
> > > > Subject: Re: Possible to place guest VM swap on local storage?
> > > > From: aemneina@gmail.com
> > > > To: users@cloudstack.apache.org
> > > >
> > > > What one can do is create a disk offering using local storage.
> > > > Then when spinning up a VM using the regular shared storage (NFS)
> > > > include a data disk that uses the local storage offering. Once the
> > > > guest boots it should understand that it has to use the additional
> > > > disk for swap
> > space.
> > > > Accomplishing this via scripts... Hope that helps.
> > > > On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com>
> > wrote:
> > > >
> > > > > Typically, I configure primary storage onto an NFS server with a
> > > > > RAID1 array, and expose that zone-wide.Works fine.
> > > > > However, it strikes me that it makes little sense to allow guest
> > > > > VMs to place their swap files there - which is thesimple model
> > > > > currently
> > in place.
> > > > > What I would prefer, and makes sense from a performance point of
> > > > > view, is to define a number of swap partitionson disk images
> > > > > residing on the local storage system of my KVM host.
> > > > > I've been over the documentation several times and it seems that
> > > > > options for configuring this setup are notgranular enough: I
> > > > > want primary storage defined in the NFS to be the default locus
> > > > > for storage, while local storageto be the locus for specifically
> > > > > placed swap
> > resources.
> > > > > Has anybody done this, or know how this can be done?
> > > > > TIA, Noel
> > >
> >

RE: Possible to place guest VM swap on local storage?

Posted by Noel Kendall <no...@hotmail.com>.
It was a fresh installation. There was no row in the config with name=use.local.storage. I had to insert it.

> From: koushik.das@citrix.com
> To: users@cloudstack.apache.org
> Subject: RE: Possible to place guest VM swap on local storage?
> Date: Tue, 13 Aug 2013 05:46:13 +0000
> 
> 
> > Hope this helps anyone else trying to do the same thing. The two surprises in
> > the process were the automatic creation of the primary storage, and the
> > missing configuration row in the database (bug).
> > N
> 
> When local storage setting is enabled at the zone then local primary stores attached to the host automatically gets discovered while adding the host. For already added host the discovery happens after MS is restarted.
> About the missing config, is it a new installation or an upgraded one? The config needs to be present in both scenarios.
> 
> -Koushik
> 
> > > From: noeldkendall@hotmail.com
> > > To: users@cloudstack.apache.org
> > > Subject: RE: Possible to place guest VM swap on local storage?
> > > Date: Mon, 12 Aug 2013 20:24:27 -0400
> > >
> > > Your suggestion is exactly the process I attempted to follow, but it was not
> > permitted,which is why I have come to the forum. I defined a storage service
> > offering, local, of1G.
> > > When I try to create a data disk using that offering, the attempt fails with
> > the message 'Zone is not configured to use local storage but volume's disk
> > offering LocalSwap uses it'.I understand that the 'local storage' enabling
> > configuration is in the zone definition, and isalterable at any time. I see the
> > box in the UI to enable it.
> > > This leaves me a dilemma... if I configure the zone to use local storage, then
> > I am uncertainof the degree of risk to which I expose the zone... does my
> > next VM ROOT disk end up onlocal? Or is that taken because the VM disk
> > offering will use 'shared' and this is how the placementis controlled - via
> > shared/local? I want to be sure before I do this, as I have a number ofguests
> > and data disks already defined and do not dare risk blowing up this running
> > cloud.
> > > Thanks for the response!
> > >
> > > > Date: Mon, 12 Aug 2013 17:03:14 -0700
> > > > Subject: Re: Possible to place guest VM swap on local storage?
> > > > From: aemneina@gmail.com
> > > > To: users@cloudstack.apache.org
> > > >
> > > > What one can do is create a disk offering using local storage. Then
> > > > when spinning up a VM using the regular shared storage (NFS) include
> > > > a data disk that uses the local storage offering. Once the guest
> > > > boots it should understand that it has to use the additional disk for swap
> > space.
> > > > Accomplishing this via scripts... Hope that helps.
> > > > On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com>
> > wrote:
> > > >
> > > > > Typically, I configure primary storage onto an NFS server with a
> > > > > RAID1 array, and expose that zone-wide.Works fine.
> > > > > However, it strikes me that it makes little sense to allow guest
> > > > > VMs to place their swap files there - which is thesimple model currently
> > in place.
> > > > > What I would prefer, and makes sense from a performance point of
> > > > > view, is to define a number of swap partitionson disk images
> > > > > residing on the local storage system of my KVM host.
> > > > > I've been over the documentation several times and it seems that
> > > > > options for configuring this setup are notgranular enough: I want
> > > > > primary storage defined in the NFS to be the default locus for
> > > > > storage, while local storageto be the locus for specifically placed swap
> > resources.
> > > > > Has anybody done this, or know how this can be done?
> > > > > TIA, Noel
> > >
> > 
 		 	   		  

RE: Possible to place guest VM swap on local storage?

Posted by Koushik Das <ko...@citrix.com>.
> Hope this helps anyone else trying to do the same thing. The two surprises in
> the process were the automatic creation of the primary storage, and the
> missing configuration row in the database (bug).
> N

When local storage setting is enabled at the zone then local primary stores attached to the host automatically gets discovered while adding the host. For already added host the discovery happens after MS is restarted.
About the missing config, is it a new installation or an upgraded one? The config needs to be present in both scenarios.

-Koushik

> > From: noeldkendall@hotmail.com
> > To: users@cloudstack.apache.org
> > Subject: RE: Possible to place guest VM swap on local storage?
> > Date: Mon, 12 Aug 2013 20:24:27 -0400
> >
> > Your suggestion is exactly the process I attempted to follow, but it was not
> permitted,which is why I have come to the forum. I defined a storage service
> offering, local, of1G.
> > When I try to create a data disk using that offering, the attempt fails with
> the message 'Zone is not configured to use local storage but volume's disk
> offering LocalSwap uses it'.I understand that the 'local storage' enabling
> configuration is in the zone definition, and isalterable at any time. I see the
> box in the UI to enable it.
> > This leaves me a dilemma... if I configure the zone to use local storage, then
> I am uncertainof the degree of risk to which I expose the zone... does my
> next VM ROOT disk end up onlocal? Or is that taken because the VM disk
> offering will use 'shared' and this is how the placementis controlled - via
> shared/local? I want to be sure before I do this, as I have a number ofguests
> and data disks already defined and do not dare risk blowing up this running
> cloud.
> > Thanks for the response!
> >
> > > Date: Mon, 12 Aug 2013 17:03:14 -0700
> > > Subject: Re: Possible to place guest VM swap on local storage?
> > > From: aemneina@gmail.com
> > > To: users@cloudstack.apache.org
> > >
> > > What one can do is create a disk offering using local storage. Then
> > > when spinning up a VM using the regular shared storage (NFS) include
> > > a data disk that uses the local storage offering. Once the guest
> > > boots it should understand that it has to use the additional disk for swap
> space.
> > > Accomplishing this via scripts... Hope that helps.
> > > On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com>
> wrote:
> > >
> > > > Typically, I configure primary storage onto an NFS server with a
> > > > RAID1 array, and expose that zone-wide.Works fine.
> > > > However, it strikes me that it makes little sense to allow guest
> > > > VMs to place their swap files there - which is thesimple model currently
> in place.
> > > > What I would prefer, and makes sense from a performance point of
> > > > view, is to define a number of swap partitionson disk images
> > > > residing on the local storage system of my KVM host.
> > > > I've been over the documentation several times and it seems that
> > > > options for configuring this setup are notgranular enough: I want
> > > > primary storage defined in the NFS to be the default locus for
> > > > storage, while local storageto be the locus for specifically placed swap
> resources.
> > > > Has anybody done this, or know how this can be done?
> > > > TIA, Noel
> >
> 

RE: Possible to place guest VM swap on local storage?

Posted by Noel Kendall <no...@hotmail.com>.
I can update with the following: I had to enable the 'use.local.storage' configuration setting - however, one quickly discovers that thisconfiguration value has been OMITTED in V4.1. I had to perform a manual mysql INSERT to add it to the configuration, with a valuesetting of 'true', under component 'management-server'.
Additionally, I had to enable local storage in the zone.
After restarting both the cloud manager and the cloud agent on the KVM host, I saw a primary storage added to the configuration thatmatched the name of the host. On that primary storage, I added the tag 'swap'.
Similarly, I configured a disk service offering that pointed to local storage, also with the tag 'swap'.
I created a new virtual disk, using the service offering, and attached it to the running VM. Adding new swap space on the drive was thenpure guest administration.
Hope this helps anyone else trying to do the same thing. The two surprises in the process were the automatic creation of the primary storage, and the missing configuration row in the database (bug).
N
> From: noeldkendall@hotmail.com
> To: users@cloudstack.apache.org
> Subject: RE: Possible to place guest VM swap on local storage?
> Date: Mon, 12 Aug 2013 20:24:27 -0400
> 
> Your suggestion is exactly the process I attempted to follow, but it was not permitted,which is why I have come to the forum. I defined a storage service offering, local, of1G.
> When I try to create a data disk using that offering, the attempt fails with the message 'Zone is not configured to use local storage but volume's disk offering LocalSwap uses it'.I understand that the 'local storage' enabling configuration is in the zone definition, and isalterable at any time. I see the box in the UI to enable it.
> This leaves me a dilemma... if I configure the zone to use local storage, then I am uncertainof the degree of risk to which I expose the zone... does my next VM ROOT disk end up onlocal? Or is that taken because the VM disk offering will use 'shared' and this is how the placementis controlled - via shared/local? I want to be sure before I do this, as I have a number ofguests and data disks already defined and do not dare risk blowing up this running cloud.
> Thanks for the response!
> 
> > Date: Mon, 12 Aug 2013 17:03:14 -0700
> > Subject: Re: Possible to place guest VM swap on local storage?
> > From: aemneina@gmail.com
> > To: users@cloudstack.apache.org
> > 
> > What one can do is create a disk offering using local storage. Then when
> > spinning up a VM using the regular shared storage (NFS) include a data disk
> > that uses the local storage offering. Once the guest boots it should
> > understand that it has to use the additional disk for swap space.
> > Accomplishing this via scripts... Hope that helps.
> > On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com> wrote:
> > 
> > > Typically, I configure primary storage onto an NFS server with a RAID1
> > > array, and expose that zone-wide.Works fine.
> > > However, it strikes me that it makes little sense to allow guest VMs to
> > > place their swap files there - which is thesimple model currently in place.
> > > What I would prefer, and makes sense from a performance point of view, is
> > > to define a number of swap partitionson disk images residing on the local
> > > storage system of my KVM host.
> > > I've been over the documentation several times and it seems that options
> > > for configuring this setup are notgranular enough: I want primary storage
> > > defined in the NFS to be the default locus for storage, while local
> > > storageto be the locus for specifically placed swap resources.
> > > Has anybody done this, or know how this can be done?
> > > TIA, Noel
>  		 	   		  
 		 	   		  

RE: Possible to place guest VM swap on local storage?

Posted by Noel Kendall <no...@hotmail.com>.
Your suggestion is exactly the process I attempted to follow, but it was not permitted,which is why I have come to the forum. I defined a storage service offering, local, of1G.
When I try to create a data disk using that offering, the attempt fails with the message 'Zone is not configured to use local storage but volume's disk offering LocalSwap uses it'.I understand that the 'local storage' enabling configuration is in the zone definition, and isalterable at any time. I see the box in the UI to enable it.
This leaves me a dilemma... if I configure the zone to use local storage, then I am uncertainof the degree of risk to which I expose the zone... does my next VM ROOT disk end up onlocal? Or is that taken because the VM disk offering will use 'shared' and this is how the placementis controlled - via shared/local? I want to be sure before I do this, as I have a number ofguests and data disks already defined and do not dare risk blowing up this running cloud.
Thanks for the response!

> Date: Mon, 12 Aug 2013 17:03:14 -0700
> Subject: Re: Possible to place guest VM swap on local storage?
> From: aemneina@gmail.com
> To: users@cloudstack.apache.org
> 
> What one can do is create a disk offering using local storage. Then when
> spinning up a VM using the regular shared storage (NFS) include a data disk
> that uses the local storage offering. Once the guest boots it should
> understand that it has to use the additional disk for swap space.
> Accomplishing this via scripts... Hope that helps.
> On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com> wrote:
> 
> > Typically, I configure primary storage onto an NFS server with a RAID1
> > array, and expose that zone-wide.Works fine.
> > However, it strikes me that it makes little sense to allow guest VMs to
> > place their swap files there - which is thesimple model currently in place.
> > What I would prefer, and makes sense from a performance point of view, is
> > to define a number of swap partitionson disk images residing on the local
> > storage system of my KVM host.
> > I've been over the documentation several times and it seems that options
> > for configuring this setup are notgranular enough: I want primary storage
> > defined in the NFS to be the default locus for storage, while local
> > storageto be the locus for specifically placed swap resources.
> > Has anybody done this, or know how this can be done?
> > TIA, Noel
 		 	   		  

Re: Possible to place guest VM swap on local storage?

Posted by Ahmad Emneina <ae...@gmail.com>.
What one can do is create a disk offering using local storage. Then when
spinning up a VM using the regular shared storage (NFS) include a data disk
that uses the local storage offering. Once the guest boots it should
understand that it has to use the additional disk for swap space.
Accomplishing this via scripts... Hope that helps.
On Aug 12, 2013 4:27 PM, "Noel Kendall" <no...@hotmail.com> wrote:

> Typically, I configure primary storage onto an NFS server with a RAID1
> array, and expose that zone-wide.Works fine.
> However, it strikes me that it makes little sense to allow guest VMs to
> place their swap files there - which is thesimple model currently in place.
> What I would prefer, and makes sense from a performance point of view, is
> to define a number of swap partitionson disk images residing on the local
> storage system of my KVM host.
> I've been over the documentation several times and it seems that options
> for configuring this setup are notgranular enough: I want primary storage
> defined in the NFS to be the default locus for storage, while local
> storageto be the locus for specifically placed swap resources.
> Has anybody done this, or know how this can be done?
> TIA, Noel