Skip to content

VMWware: support to update guest info gc status if enabled#261

Merged
OddBloke merged 5 commits into
canonical:masterfrom
xiaofengw1205:xiaofengw-vmware-update-guestinfo-gc-status
Mar 26, 2020
Merged

VMWware: support to update guest info gc status if enabled#261
OddBloke merged 5 commits into
canonical:masterfrom
xiaofengw1205:xiaofengw-vmware-update-guestinfo-gc-status

Conversation

@xiaofengw1205

@xiaofengw1205 xiaofengw1205 commented Mar 19, 2020

Copy link
Copy Markdown
Contributor

VMWare: support to update guest info gc status if gc status is enabled in configuration file.

Comment thread cloudinit/sources/DataSourceOVF.py Outdated
self._vmware_cust_conf = Config(cf)
post_gc_status = self._vmware_cust_conf.post_gc_status
if post_gc_status:
set_gc_status("Started")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still looking to have the fix requested in #215 (comment) fixed here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi OddBloke,
Sorry I misunderstood that you agreed to not move this check into set_gc_status() function. If I still need to move it, then this function will looks like "set_gc_status(gcMsg, vmware_cust_conf)". Each time we set the gc status, we need to parse the vmware cust conf and read boolean "MISC|POST-GC-STATUS". It might be not efficient, do you agree? Thanks.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Each time we set the gc status, we need to parse the vmware cust conf and read boolean "MISC|POST-GC-STATUS". It might be not efficient, do you agree?

I may not be following the logic through correctly, but it looks to me like ConfigFile takes care of reading the config file a single time, so I don't believe this is an accurate description of the additional work that would be performed. I think we're really just talking about a few additional Python dict operations, which is not a significant cost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Address your comments, PTAL, thanks a lot.

@OddBloke OddBloke self-assigned this Mar 20, 2020

@OddBloke OddBloke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the update, this looks good now! Could we please add some unit tests for set_gc_status? With those added, I think this will be ready to land.

Comment on lines +163 to +164
else:
return None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A nit, but as the above if returns unconditionally, we don't need the else here:

Suggested change
else:
return None
return None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, the unit test and this comment are addressed. Please check.

@OddBloke OddBloke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@OddBloke
OddBloke merged commit 1fefeef into canonical:master Mar 26, 2020
@blackboxsw

blackboxsw commented Jun 24, 2020

Copy link
Copy Markdown
Collaborator

Request for SRU testing:

Hello @xiaofengw-vmware,
Cloud-init has currently queued this feature for release as cloud-init version 20.2.45 in Ubuntu 16.04 (Xenial), 18.04 (Bionic). 19.10 (Eoan) and 20.04 (Focal) the -proposed apt pocket. Our ability to exercise this feature is limited on our vSphere install.

If you happen to get a chance to validate that this feature behaves as expected we would appreciate any feedback you may have as a comment on the SRU process bug #1881018.

Details on testing a the -proposed release of cloud-init are available here if you happen to have a chance to kick off and validate that you patch behaves without causing Tracebacks.

Thank you for making cloud-init better,
Cloud-init upstream team

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.

3 participants