Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Mar 29, 2019

Description

Problem: Service, disk, network, and VPC offerings cannot be linked to specified multiple domain(s) and zone(s).
Root cause: Service, disk, network, and VPC offerings are independent of zones. Service and disk offerings can be linked only to a single domain/sub-domain
Solution: Service, disk, network, and VPC offerings will be allowed to be created with specified domain(s) and zone(s). Offerings linked with multiple domains and zones can be created both with UI and API. Refactored create offering API to allow the passing list of domain and zone IDs with domainid and zoneid parameter respectively. UI has been refactored to allow selecting multiple domains and zones while creating offering using multi-select elements. When the list of passed domains contain both parent and child domains, the offering will be created for the parent domain. Offering details will now show a list of linked domains and zones as a comma-separated list of names. Linked domains and zones will be stored in the cloud.*_offering_details table in the database as a separate row for each domain and zone ID with key domainid and zoneid respectively.
Linked domain(s) and zone(s) for an offering (service, disk, network, or VPC) can be updated using update*Offering API. To make a domain-specific offering public by root admin, domainid=public can be passed in the API call. To make a zone specific offering available for all zones by root admin, zoneid=all can be passed in the API call. Update Offering Access action has been added to the offerings page in UI which will allow updating linked domain(s) and zone(s) for an offering.
Domain-admins can update compute and disk offerings. However, they can not change zones for the offerings specified for their domain or subdomains. They cannot change name, display text, sort-key for offerings specified for their domains/subdomains and also other domains which are not child domain for them. They can chnage domains(within their subdomains) for the offerings specified for their domains/subdomains.

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):

Updated create offering forms
Screenshot from 2019-05-24 14-39-41
Screenshot from 2019-05-24 14-40-46
Screenshot from 2019-05-24 14-41-18
Screenshot from 2019-05-24 14-41-42

Updated disk offering details with domains and zones,
Screenshot from 2019-03-27 17-07-44

Update Offering Access UI
Screenshot from 2019-06-24 16-28-23
Screenshot from 2019-06-24 16-28-34

Cloudmonkey API call
Screenshot from 2019-03-27 17-07-27

Update offering API call

update serviceoffering id=02cd857c-0009-4f8f-8dc6-96d86745a88f domainid=public zoneid=all
{
  "serviceoffering": {
    "cpunumber": 1,
    "cpuspeed": 1000,
    "created": "2019-06-21T14:55:25+0530",
    "defaultuse": false,
    "displaytext": "lol",
    "id": "02cd857c-0009-4f8f-8dc6-96d86745a88f",
    "iscustomized": false,
    "issystem": false,
    "isvolatile": false,
    "limitcpuuse": false,
    "memory": 1234,
    "name": "lol",
    "offerha": false,
    "provisioningtype": "thin",
    "storagetype": "shared"
  }
}

update serviceoffering id=02cd857c-0009-4f8f-8dc6-96d86745a88f zoneid=3d2139c0-b122-46ec-9167-6312f5928f11,8d616250-146f-4694-a167-c6c0795f8bcf domainid=804ebc06-f5d2-46e7-b84c-670bd0a02398,3aeefdda-f1e1-4c74-a0cb-062f42ccef05
{
  "serviceoffering": {
    "cpunumber": 1,
    "cpuspeed": 1000,
    "created": "2019-06-21T14:55:25+0530",
    "defaultuse": false,
    "displaytext": "lol",
    "domain": "L11,Something",
    "domainid": "3aeefdda-f1e1-4c74-a0cb-062f42ccef05,804ebc06-f5d2-46e7-b84c-670bd0a02398",
    "id": "02cd857c-0009-4f8f-8dc6-96d86745a88f",
    "iscustomized": false,
    "issystem": false,
    "isvolatile": false,
    "limitcpuuse": false,
    "memory": 1234,
    "name": "lol",
    "offerha": false,
    "provisioningtype": "thin",
    "serviceofferingdetails": {
      "domainid": "5",
      "zoneid": "2"
    },
    "storagetype": "shared",
    "zone": "Sandbox-simulator,Sandbox-simulator1",
    "zoneid": "3d2139c0-b122-46ec-9167-6312f5928f11,8d616250-146f-4694-a167-c6c0795f8bcf"
  }
}

How Has This Been Tested?

From UI and cmk

@rohityadavcloud rohityadavcloud force-pushed the storage-offering-domains-zones branch from ea163b8 to 3b9e2b5 Compare March 29, 2019 06:22
@rohityadavcloud rohityadavcloud changed the title server: disk offerings for specified domain(s) and zone(s) [WIP DO NOT MERGE] server: disk offerings for specified domain(s) and zone(s) Mar 29, 2019
@rohityadavcloud rohityadavcloud added this to the 4.13.0.0 milestone Mar 29, 2019
@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos6 ✖centos7 ✖debian. JID-2662

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

There seems to be some build issues here, could you please investigate @shwstppr

@shwstppr shwstppr force-pushed the storage-offering-domains-zones branch 3 times, most recently from 3f03aed to 30d5f52 Compare April 1, 2019 06:21
@rohityadavcloud rohityadavcloud force-pushed the storage-offering-domains-zones branch from 30d5f52 to 46e1cc6 Compare April 1, 2019 09:11
@shwstppr shwstppr changed the title [WIP DO NOT MERGE] server: disk offerings for specified domain(s) and zone(s) [WIP DO NOT MERGE] server: offerings for specified domain(s) and zone(s) Apr 9, 2019
entityType = ZoneResponse.class,
description = "id of zone disk offering is associated with",
since = "4.13")
private Long zoneId;
Copy link
Contributor

Choose a reason for hiding this comment

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

only for a zone, not for domains or multiple zones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DaanHoogland List APIs are changed only for a single zone. Multiple domains and zones can be specified with create or update APIs.
Single zone in list API is needed as when we create storage, network or deploy VM we select or specify a particular zone. Therefore we need to query those offerings which are available for that particular zone or domain(through calling account).

entityType = ZoneResponse.class,
description = "id of zone disk offering is associated with",
since = "4.13")
private Long zoneId;
Copy link
Contributor

Choose a reason for hiding this comment

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

again, only for a single zone, not domains?

private Boolean supportsPublicAccess;

@SerializedName(ApiConstants.DOMAIN_ID)
@Param(description = "the domain ID(s) this disk offering belongs to. Ignore this information as it is not currently applicable.")
Copy link
Contributor

Choose a reason for hiding this comment

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

said to be multiple but the getter does not seem to facilitate this

Copy link
Contributor Author

@shwstppr shwstppr Apr 12, 2019

Choose a reason for hiding this comment

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

Multiple domains are supported with a comma-separated list of domain IDs. This is done to maintain backward compatibility and consistency. ServiceOfferingResponse and DiskOfferingResponse already had a domainId parameter and if an array of IDs would have been used instead of comma-separated string it might have broken automation scripts for some.

cmk example for VPCOffering response,
Screenshot from 2019-04-12 20-32-23

@PaulAngus
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2720

@PaulAngus
Copy link
Member

@blueorangutan matrix

@rohityadavcloud
Copy link
Member

@shwstppr can you fix the conflicts?

shwstppr and others added 8 commits May 24, 2019 09:56
Allows creating storage offerings associated with particular domain(s) and zone(s). In create disk/storage offfering form UI, a mult-select control has been addded to select desired zone(s) and domain select element has been made multi-select.
createDiskOffering API has been modified to allow passing list of domain and zone IDs with keys domainids and zoneids respectively. These lists are stored in DB in cloud.disk_offering_details table with 'domainids' and 'zoneids' key as string of comma separated list of IDs. Response for create, update and list disk offering APIs will return domainids, domainnames, zoneids and zonenames in details object of offering.
listDiskOfferings API has been modified to allow passing zoneid to return only offerings which are associated with the zone.

Signed-off-by: Abhishek Kumar <[email protected]>
Signed-off-by: Rohit Yadav <[email protected]>
Signed-off-by: Rohit Yadav <[email protected]>
Signed-off-by: Rohit Yadav <[email protected]>
@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-107

@PaulAngus PaulAngus changed the title [WIP DO NOT MERGE] server: offerings for specified domain(s) and zone(s) [WIP DO NOT MERGE] service offerings for specified domain(s) and zone(s) Jul 11, 2019
@PaulAngus PaulAngus changed the title [WIP DO NOT MERGE] service offerings for specified domain(s) and zone(s) [WIP DO NOT MERGE] Enable service offerings to be scoped to domain(s) and zone(s) Jul 11, 2019
@rohityadavcloud
Copy link
Member

Let's repackage one of the UI issues was fixed recently on master.
@blueorangutan package

@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: ✔centos6 ✔centos7 ✔debian. JID-121

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-123

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, reviewed the latest fixes

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

Copy link
Contributor

@anuragaw anuragaw left a comment

Choose a reason for hiding this comment

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

LGTM

@rohityadavcloud
Copy link
Member

Ping @PaulAngus @borisstoyanov

@shwstppr shwstppr closed this Jul 16, 2019
@shwstppr shwstppr reopened this Jul 16, 2019
@shwstppr shwstppr changed the title [WIP DO NOT MERGE] Enable service offerings to be scoped to domain(s) and zone(s) Enable service offerings to be scoped to domain(s) and zone(s) Jul 16, 2019
@PaulAngus
Copy link
Member

LGTM based on manual testing.

@PaulAngus PaulAngus self-requested a review July 16, 2019 09:24
Copy link
Member

@PaulAngus PaulAngus left a comment

Choose a reason for hiding this comment

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

LGTM based on manual testing

@PaulAngus PaulAngus merged commit e15c311 into apache:master Jul 16, 2019
@rohityadavcloud
Copy link
Member

Was the branch merged @PaulAngus @shwstppr? I'll request again that PRs be squash+merged and branches not be merged as is to avoid fragmentation of commits wrt a feature or a bug.

@shwstppr
Copy link
Contributor Author

Was the branch merged @PaulAngus @shwstppr? I'll request again that PRs be squash+merged and branches not be merged as is to avoid fragmentation of commits wrt a feature or a bug.

Can we revert and squash-merge again @rhtyd?

@rohityadavcloud
Copy link
Member

No need.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants