cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Add volume group handling

Open DK101010 opened this issue 3 years ago • 85 comments

Description

Motivation: Some applications needs an specific volume controller configuration. For example to get a optimal performance or it is necessary to get an certificate. Therefore admins needs a opportunity to add an volume to certain controller.

Implementation: Decided to add a VolumeGroup class as an abstract object to manage this feature. A volume group is a triple of vm id, volume id and group number.

  • group number == bus number
  • groups are optional, user can work like before
  • groups can only created via api
  • during the attach the group will be create
  • if vm have got mixed volumes with and without groups, attach order is: root vol, vol with groups(order by disk seq), vols without groups(order by disk seq).
  • for import unmanaged VMs user have got three option: 1. can do like before (no groups) => import with current conf, after restart volumes will be attached on the first controller until max and then second controller and so on. (applied after restart) 2. add vol groups to disk offering list => add groups like user want it (applied after restart) 3. set useControllerConfiguration = true => read current controller conf of unmanaged vm and add automatic volumegroups for each volume

SQL for Update:

DROP TABLE IF EXISTS `cloud`.`volume_group`;
CREATE TABLE IF NOT EXISTS `cloud`.`volume_group`(
    `id` bigint unsigned PRIMARY KEY AUTO_INCREMENT COMMENT 'Primary Key',
    `vm_id` bigint unsigned NOT NULL COMMENT 'foreign key to vm table',
    `volume_id` bigint unsigned NOT NULL COMMENT 'foreign key to volume table',
    `group_number` int unsigned NOT NULL COMMENT 'group number of volume',
    FOREIGN KEY(vm_id) REFERENCES vm_instance (id),
    FOREIGN KEY(volume_id) REFERENCES volumes (id)
);

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] Enhancement (improves an existing feature and functionality)
  • [ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [x] Major
  • [ ] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

DK101010 avatar Feb 21 '22 08:02 DK101010

like the idea, is this (meant to be) vmware only?

In the future also for KVM but for now only for vmware.

DK101010 avatar Feb 21 '22 09:02 DK101010

Hi @DaanHoogland, @nvazquez, I have a question, what I have to do to add follow code

def importUnmanagedInstance(self, command, method="GET"):
         response = importUnmanagedInstanceResponse()
         response = self.connection.marvinRequest(command, response_type=response, method=method)
         return response  

to

cloudstack/tools/marvin/marvin/cloudstack/cloudstackAPIClient.py

I added in my env, but it seems to be automated generated or ?

DK101010 avatar Mar 22 '22 08:03 DK101010

Hi @DaanHoogland, @nvazquez, I have a question, what I have to do to add follow code

cloudstack/tools/marvin/marvin/cloudstack/cloudstackAPIClient.py

I added in my env, but it seems to be automated generated or ?

yes, it should be auto generated.

DaanHoogland avatar Mar 22 '22 12:03 DaanHoogland

Hi @DK101010 - just extending @DaanHoogland's answer. It should be generated by building marvin: mvn -P developer -pl :cloud-marvin and upgrade the packages pip install --upgrade tools/marvin/dist/Marvin-*.tar.gz

nvazquez avatar Mar 22 '22 12:03 nvazquez

Ahh, ok a case of self confusion :D. Thanks you two

DK101010 avatar Mar 22 '22 13:03 DK101010

Hi @${author}, your pull request has merge conflicts. Can you fix the conflicts and sync your branch with the base branch?

github-actions[bot] avatar Apr 07 '22 05:04 github-actions[bot]

Soo, I guess I'm finished and ready for review :)

DK101010 avatar Apr 12 '22 10:04 DK101010

Soo, I guess I'm finished and ready for review :)

you mean you are taking it out of draft @DK101010 ?

DaanHoogland avatar Apr 13 '22 06:04 DaanHoogland

Soo, I guess I'm finished and ready for review :)

you mean you are taking it out of draft @DK101010 ?

Japp, correct.

DK101010 avatar Apr 13 '22 06:04 DK101010

Soo, I guess I'm finished and ready for review :)

you mean you are taking it out of draft @DK101010 ?

Japp, correct.

:grin: than do so ;)

DaanHoogland avatar Apr 13 '22 07:04 DaanHoogland

Soo, I guess I'm finished and ready for review :)

you mean you are taking it out of draft @DK101010 ?

Japp, correct.

😁 than do so ;)

Oh, how I can do it? :D I can only editing the description and the headline.

DK101010 avatar Apr 13 '22 08:04 DK101010

Soo, I guess I'm finished and ready for review :)

you mean you are taking it out of draft @DK101010 ?

Japp, correct.

grin than do so ;)

Oh, how I can do it? :D I can only editing the description and the headline.

You don't see the Ready for review button below here?

DaanHoogland avatar Apr 13 '22 08:04 DaanHoogland

also @DK101010 , if you go to files you should be able to commit multiple suggestions in one commit.

DaanHoogland avatar Apr 13 '22 08:04 DaanHoogland

also @DK101010 , if you go to files you should be able to commit multiple suggestions in one commit.

Thanks for the hint, I will try it next time. Or I could squash the commits if there are too many.

DK101010 avatar Apr 13 '22 11:04 DK101010

@blueorangutan package

DaanHoogland avatar Apr 14 '22 10:04 DaanHoogland

@blueorangutan package

nvazquez avatar Apr 16 '22 03:04 nvazquez

@nvazquez a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Apr 16 '22 03:04 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3186

blueorangutan avatar Apr 16 '22 04:04 blueorangutan

@blueorangutan package

DaanHoogland avatar Apr 19 '22 16:04 DaanHoogland

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Apr 19 '22 16:04 blueorangutan

Hi @DK101010 there are some conflicts on this PR, can you please fix?

nvazquez avatar Apr 19 '22 16:04 nvazquez

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3217

blueorangutan avatar Apr 19 '22 16:04 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Apr 25 '22 06:04 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Apr 25 '22 07:04 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6012 (SL-JID-1454)

blueorangutan avatar Apr 25 '22 07:04 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Apr 25 '22 08:04 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Apr 25 '22 08:04 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6012 (SL-JID-1457)

blueorangutan avatar Apr 25 '22 08:04 blueorangutan

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jun 10 '22 12:06 github-actions[bot]

@blueorangutan package

DaanHoogland avatar Sep 21 '22 08:09 DaanHoogland