Skip to content

Allow option of exposing VM domain info via instance metadata#6710

Merged
yadvr merged 4 commits intoapache:mainfrom
mlsorensen:domain-in-instance-data-main
Sep 22, 2022
Merged

Allow option of exposing VM domain info via instance metadata#6710
yadvr merged 4 commits intoapache:mainfrom
mlsorensen:domain-in-instance-data-main

Conversation

@mlsorensen
Copy link
Copy Markdown
Contributor

@mlsorensen mlsorensen commented Sep 6, 2022

Signed-off-by: Marcus Sorensen mls@apple.com

Description

This PR allows the cloud admin to set either a global or domain-specific value "metadata.allow.expose.domain", and when set this allows the VM to see the name and ID of the immediate domain that contains the VM in instance metadata. This can be useful or a variety of things such as bootstrapping VM configuration and access according to domain.

This PR also deletes the CloudZonesNetworkElement because it isn't referred to anywhere, and there was initially some confusion as to whether this code needed to be updated when extending metadata. If it needs to be kept we can remove that delete from the PR.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

[root@test-vm ~]# cloud-init query ds.meta_data.cloud_domain
mydomain

[root@test-vm ~]# cloud-init query ds.meta_data.cloud_domain_id
e41e92fa-0498-4e76-b4b3-5948a44a9309

How Has This Been Tested?

Tested in a local branch, released to an internal UAT environment for a few weeks. Also updated metadata Marvin test.

Tested both setting "metadata.allow.expose.domain" true and false, and going back and forth. Need to restart the VM for changes to take effect.

Signed-off-by: Marcus Sorensen <mls@apple.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 6, 2022

Codecov Report

Merging #6710 (6c6e78c) into main (687a21c) will increase coverage by 4.51%.
The diff coverage is 38.88%.

@@             Coverage Diff              @@
##               main    #6710      +/-   ##
============================================
+ Coverage      5.90%   10.41%   +4.51%     
- Complexity     3946     6684    +2738     
============================================
  Files          2454     2453       -1     
  Lines        242749   242909     +160     
  Branches      37991    38032      +41     
============================================
+ Hits          14325    25305   +10980     
+ Misses       226839   214441   -12398     
- Partials       1585     3163    +1578     
Impacted Files Coverage Δ
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 0.00% <ø> (ø)
...a/com/cloud/network/router/CommandSetupHelper.java 0.12% <0.00%> (+0.12%) ⬆️
.../main/java/com/cloud/network/NetworkModelImpl.java 10.91% <75.00%> (+10.91%) ⬆️
.../main/java/com/cloud/vm/VirtualMachineManager.java 91.66% <100.00%> (+18.93%) ⬆️
...apache/cloudstack/alert/snmp/SnmpTrapAppender.java 58.94% <0.00%> (-2.11%) ⬇️
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% <0.00%> (ø)
.../baremetal/networkservice/BaremetaNetworkGuru.java 0.00% <0.00%> (ø)
...bernetes/cluster/KubernetesClusterManagerImpl.java 0.00% <0.00%> (ø)
...ava/com/cloud/network/as/AutoScaleManagerImpl.java 0.12% <0.00%> (+0.12%) ⬆️
... and 457 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mlsorensen
Copy link
Copy Markdown
Contributor Author

Not sure why the code coverage is complaining on the appenders, seems unrelated to the PR.

@yadvr yadvr added this to the 4.18.0.0 milestone Sep 8, 2022
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 8, 2022

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud 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.

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 8, 2022

@DaanHoogland how can we run a specific component test with BO?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rohityadavcloud we had disabled the feature in BO two or three years ago as it was never used. I'll look at reimplement it.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4146

Copy link
Copy Markdown
Contributor

@GutoVeronezi GutoVeronezi left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread engine/api/src/main/java/com/cloud/vm/VirtualMachineManager.java Outdated
Comment thread server/src/main/java/com/cloud/network/NetworkModelImpl.java Outdated
Comment thread server/src/main/java/com/cloud/network/NetworkModelImpl.java
mlsorensen and others added 2 commits September 12, 2022 10:35
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
@acs-robot
Copy link
Copy Markdown

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

1 similar comment
@acs-robot
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6710 (SL-JID-2340)

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

17.7% 17.7% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
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.

CLGTM

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Sep 14, 2022

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud 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
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4185

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

Trillian Build Failed (tid-4907)

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4908)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39425 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6710-t4908-kvm-centos7.zip
Smoke tests completed. 101 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 563.16 test_kubernetes_clusters.py

Copy link
Copy Markdown
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

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

LGTM, the one failing test is intermittent failure not caused by this PR

@yadvr yadvr merged commit 1a0a61f into apache:main Sep 22, 2022
@mlsorensen mlsorensen deleted the domain-in-instance-data-main branch September 22, 2022 20:22
harikrishna-patnala added a commit that referenced this pull request Sep 26, 2022
harikrishna-patnala added a commit that referenced this pull request Oct 3, 2022
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.

6 participants