I did some testing today with the following setup:

2 disk offerings: 1 for shared storage and 1 for local storage. Both with "Disk 
size strictness false" and using the a tag to map it to the corresponding 
primary storage.
2 compute offerings: 1 for shared storage with ha enabled and using the created 
disk offering and 1 for local with ha disabled and using the other disk 
offering. On both compute offerings I enabled Disk offering strictness to make 
sure a user cannot override the disk offering in the UI wizard during the 
creation of the VM.

This works as expected. New VMs will be created on the respective storage. Even 
resizing the volume is working.

What I did not get to work is to change compute offering/disk offering and move 
the volume to another storage. And here starts some kind of inconsistency in CS.

migrateVirtualMachineWithVolume is able to perform a live migration from local 
to shared storage (even in UI) and ignores storage tags of disk offerings. You 
end up in a situation where your VM has a still the local compute offering 
mapped and your volume has still the local disk offering mapped, but the volume 
is on shared storage and the VM runs on a host that only has shared storage.

scaleVirtualMachine is not able to perform the task and fails with: Unable to 
upgrade virtual machine VM, target offering use shared storage but the storage 
pool where the volume is allocated is a local

changeOfferingForVolume is not working: It stops with message: Cannot resize 
ROOT volume with new disk offering since existing disk offering is strictly 
assigned to the ROOT volume.
Remember that I was able to resize the disk vi UI without any problem!

migrateVolume will not work and stops with: Disk offering cannot be changed to 
the volume since existing disk offering is strictly associated with the volume
This api call should work, because is has parameters like livemigrate and 
newdiskofferingid.


As far as I understand it is not possible to change a compute offering/disk 
offering of an instance in my scenario, but in my opinion it should be 
possible. migrateVirtualMachineWithVolume shows that you can migrate a VM with 
Volumes from local to shared storage but it is not editing the offerings.

Did I missed something. Are there any other api calls which are capable to do 
this?



-----Ursprüngliche Nachricht-----
Von: [email protected] <[email protected]> 
Gesendet: Donnerstag, 30. März 2023 11:18
An: [email protected]
Betreff: AW: Compute offerings and Disk offerings

Hi,

Ok, I get it. But if I work with 2 strict Compute offerings each using a strict 
Disk offering, it looks like I am unable to migrate a shared to local or vice 
versa via UI.
- Scale VM (Instances) does not show the other offering
- Migrate Volume (Volumes) does not show the other primary storage
- Change disk offering (Volumes) does not show the other Disk offering even 
when Auto migrate is enabled

The following steps needed to be done to achieve my goal:
- volume needs to be migrate from shared to local storage (or vice versa)
- disk offering needs to be changed
- compute offering needs to be changed

Did I missed something?

In a perfect world this should be able to do even when the VM is running and 
via UI. I will test if I can achieve it via api and if so I will open an issue 
in github for and enhancement. 

-----Ursprüngliche Nachricht-----
Von: Hean Seng <[email protected]>
Gesendet: Donnerstag, 30. März 2023 10:09
An: [email protected]
Betreff: Re: Compute offerings and Disk offerings

Hi
If you allow them in the Offering, then of cause they have the flexibility and 
you too have the flexibility .

In the current control , there is no  variable to restrict user from doing
that, and only admin can do.   It all depend on the offering you created. .

Probably you can try is restrict it at offering, and when you need to change, 
first change the Vm to another offering first, then only migrate the volumn.






On Thu, Mar 30, 2023 at 4:01 PM <[email protected]> wrote:

> Hey jordan,
>
> thx for your reply! I am suing custom offerings, my problem is to deny 
> the customer to change the Disk offering in the UI wizard when 
> creating a new VM. Of course I can use the strictness, but then I am 
> unable to migrate the volume from local to shared storage or vice versa later 
> in time.
>
> Regards,
> Swen
>
> -----Ursprüngliche Nachricht-----
> Von: jordan j <[email protected]>
> Gesendet: Donnerstag, 30. März 2023 08:15
> An: [email protected]
> Betreff: Re: Compute offerings and Disk offerings
>
> I have the same hardware setup and use the same configuration.
> Not sure if one can run away from having multiple compute offerings 
> for each storage type and server group.
> The only thing that reduced the amount of compute offerings is to set 
> both compute and disk offerings to be custom.
> So actually you have just one offering per specific server/storage 
> group with resources customizable by the users.
>
> Regards,
> Jordan
>
> On Wed, Mar 29, 2023 at 6:47 PM Hean Seng <[email protected]> wrote:
>
> > So what you actually wish to achieve ?
> >
> > On Wed, Mar 29, 2023 at 11:41 PM <[email protected]> wrote:
> >
> > > Hi Hean,
> > >
> > > sure, this works, but is not really flexible and you run into 
> > > problems when using the override function in the UI wizard.
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Hean Seng <[email protected]>
> > > Gesendet: Mittwoch, 29. März 2023 17:20
> > > An: [email protected]
> > > Betreff: Re: Compute offerings and Disk offerings
> > >
> > > Hi
> > >
> > > In Compute offering, you can choose if the compute offering is 
> > > Local or Shared Storage .
> > >
> > > And you can also tag the storage with Tags, and define the tag in 
> > > Compute offering.
> > >
> > > Like this, it will goes to the storage you wish to.
> > >
> > >
> > > On Wed, Mar 29, 2023 at 11:12 PM <[email protected]> wrote:
> > >
> > > > Hey all,
> > > >
> > > >
> > > >
> > > > does someone use local AND shared storage in Cloudstack? I am 
> > > > using tags on storage level which I use in Disk offerings then 
> > > > to assign them to shared or local storage. I use xcp-ng as 
> > > > hypervisor and each host has shared or local storage, but not both.
> > > >
> > > > I created a default-compute-offering without mapping it directly 
> > > > to a Disk offering vi api, because the UI wants to have a Disk 
> > > > offering mapped. In the VM installation wizard I can choose 
> > > > between local an shared storage and it works fine.
> > > >
> > > >
> > > >
> > > > But I run into some issues:
> > > >
> > > > 1.      I am unable to configure the default Disk offering which will
> > be
> > > > used when not overriding root disk offering
> > > >
> > > > It looks like CS is using the one with the lowest id in den database.
> > > >
> > > > 2.      When I want to migrate a running VM from local to shared
> > storage
> > > > (or
> > > > vice versa) via UI "Migrate instance to another host" I see the 
> > > > other hosts, but there are shown as not suitable.
> > > > 3.      When I want to migrate a Volume from local to shared storage
> > (or
> > > > vice versa) via UI "Migrate volume" I do not see the other type 
> > > > of storage even when enable the "Replace disk offering" button.
> > > >
> > > >
> > > >
> > > > Is my workflow just not correct, or do we have some kind of 
> > > > issue here? I hope someone else already using this setup and can 
> > > > tell me how it was configured. Thanks for help!
> > > >
> > > >
> > > >
> > > > Regards,
> > > >
> > > > Swen
> > > >
> > > >
> > >
> > > --
> > > Regards,
> > > Hean Seng
> > >
> > >
> > >
> >
> > --
> > Regards,
> > Hean Seng
> >
>
>
>

--
Regards,
Hean Seng




Reply via email to