Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: update template to another template type #3945

Merged
merged 1 commit into from
Oct 28, 2020

Conversation

ustcweizhou
Copy link
Contributor

Description

this contains other changes
(1) add isrouting field for vm templates on UI
(2) show register URL of template/iso on UI
(3) set 'Bootable' field to changable for existing ISO

Types of changes

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

Screenshots (if appropriate):

How Has This Been Tested?

this provides a easy way to upload systemvm template
(1) register template
(2) update template type from USER to SYSTEM
(3) destroy ssvm/cpvm, new systemvms will be created from the new template (latest template with type=SYSTEM)
(4) change global setting router.template.kvm (or other hypervisor) to the name of new template, new VRs will be created from the new template.

this contains other changes
(1) add isrouting field for vm templates on UI
(2) show register URL of template/iso on UI
(3) set 'Bootable' field to changable for existing ISO
@DaanHoogland
Copy link
Contributor

@weizhouapache marking for 4.14.1
It will need primate work for that, right? Can you add a ticket there?

@rohityadavcloud rohityadavcloud changed the base branch from master to 4.14 June 13, 2020 00:43
@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos7 ✖debian. JID-1367

@rohityadavcloud
Copy link
Member

@ustcweizhou do we want to restrict this to root admin only?

@weizhouapache
Copy link
Member

@ustcweizhou do we want to restrict this to root admin only?

@rhtyd
I was thinking about the following change

-    @Parameter(name = "templatetype", type = CommandType.STRING, description = "the type of the template")
+    @Parameter(name = "templatetype", type = CommandType.STRING, description = "the type of the template", authorized
+ = {RoleType.Admin})
     private String templateType;

however, when I tested with normal user or domain admin, the api succeed without templatetype change.

(test1) > update template id="ce3d5211-3209-4617-b569-6c533801a20c" templatetype=SYSTEM
{
  "template": {
    "account": "test1",
    "bits": 0,
    "bootable": true,
    "created": "2020-06-12T09:54:08+0000",
    "crossZones": false,
    "details": {
      "rootDiskController": "osdefault"
    },
    "displaytext": "ubuntu18-minimal-test1",
    "domain": "test1",
    "domainid": "931bc746-8a9a-45ec-8c50-776b89aed898",
    "format": "QCOW2",
    "hypervisor": "KVM",
    "id": "ce3d5211-3209-4617-b569-6c533801a20c",
    "isdynamicallyscalable": false,
    "isfeatured": false,
    "ispublic": false,
    "isready": false,
    "name": "ubuntu18-minimal-test1",
    "ostypeid": "67bad17c-186e-11ea-83e0-066004001165",
    "ostypename": "Apple Mac OS X 10.6 (32-bit)",
    "tags": [],
    "templatetype": "USER"
  }
}

without this change, I got following error which looks better.

(test1) > update template id="ce3d5211-3209-4617-b569-6c533801a20c" templatetype=SYSTEM
Error 531: Parameter templatetype can only be specified by a Root Admin, permission denied

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2213

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-3017)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33032 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3945-t3017-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Smoke tests completed. 83 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good. there are UI changes, can you refer to a primate ticket or pr?

@DaanHoogland
Copy link
Contributor

ping @ustcweizhou , I created apache/cloudstack-primate#835. Can you add details there?

@DaanHoogland
Copy link
Contributor

ping @PaulAngus @rhtyd merge this?

@rohityadavcloud
Copy link
Member

I see small enhanacement/improvement, tests have passed. We probably can get away with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants