Skip to content

Add server and servers#28

Merged
pkliczewski merged 3 commits intofog:core-1.45.0from
masayag:add_server_actions
Oct 17, 2018
Merged

Add server and servers#28
pkliczewski merged 3 commits intofog:core-1.45.0from
masayag:add_server_actions

Conversation

@masayag
Copy link
Copy Markdown
Collaborator

@masayag masayag commented Oct 11, 2018

No description provided.

Comment thread lib/fog/compute/kubevirt.rb Outdated
# Updates a given VM raw entity with vm instance info if exists
#
# @param vm [Hash] A hash with vm raw data.
def populate_server_with_runtime_info(vm)
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.

This seems like something we could have in vm entity. Based on responsibilities seems like it would be better place there.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure if VM is the right place for it since it deals with setting values from VitrulaMachineInstance.
I can move this one to Server if you feel it is more right .

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.

Sounds great

Comment thread lib/fog/compute/kubevirt/models/server.rb

def ready?
status == 'running' && state == 'Running' && !vmi[:ip_address].blank?
rescue
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.

Any specific error we are expecting here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

nope, should be:
status == 'running' && state == 'Running' && !ip_address.blank?

@masayag masayag force-pushed the add_server_actions branch from 30c6370 to b75f19d Compare October 11, 2018 14:02
new service.get_server(id)
end

def bootstrap(new_attributes = {})
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.

Please document potential new_attributes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

will do that in a next PR's version

:resource_version => metadata[:resourceVersion],
:uid => metadata[:uid],
:labels => metadata[:labels],
:memory => domain[:resources][:requests][:memory],
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.

This is the reason why we can reuse. We merged a PR which allows vm not to have memory but here the code would fail. I think it is not good idea to maintain it in 2 places.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

now that should be reside in a single place - see VmAction

pkliczewski and others added 2 commits October 15, 2018 12:35
It is possible to run create a vm [1] without memory requirement which
we need to handle.

[1] https://github.com/kubevirt/demo/blob/master/manifests/vm.yaml
@masayag masayag force-pushed the add_server_actions branch 7 times, most recently from dcb0eb2 to 33e254d Compare October 15, 2018 14:27
@masayag masayag force-pushed the add_server_actions branch from 33e254d to 1df6899 Compare October 17, 2018 11:24
@masayag masayag changed the title [WIP] Add server and servers Add server and servers Oct 17, 2018
@pkliczewski pkliczewski merged commit c8a14f4 into fog:core-1.45.0 Oct 17, 2018
@masayag masayag deleted the add_server_actions branch December 10, 2018 09:08
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.

2 participants