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

fixes #8295 - add vsphere memory and cpu hot add #2896

Closed

Conversation

timogoebel
Copy link
Member

This PR adds two new checkboxes to the vsphere new vm gui and allows to enable CPU and memory hot add.

@@ -18,6 +18,12 @@
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %>
<%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _("Power ON this machine"), :label => _('Start'), :label_size => "col-md-3" } if new_host and controller_name != 'compute_attributes' %>

<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:memoryHotAddEnabled] || '0' %>
<%= checkbox_f f, :memoryHotAddEnabled, { :checked => (checked == '1'), :help_inline => _("Enable memory hot add"), :label => _('Memory hot add'), :label_size => "col-md-2" } if new_host and controller_name != 'compute_attributes' %>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if you want the and controller_name != 'compute_attributes' here, as that's to prevent the checkbox appearing on the compute profile pages. It's excluded from there for the "Power ON" checkbox as it's kind of only applicable to real hosts, not compute profiles, but I think these would be useful set on compute profiles too.

I think that means you can also get rid of the "checked" variable and simply leave :checked out, a bit like external_ip on in gce/_base.

Copy link
Contributor

Choose a reason for hiding this comment

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

And lastly, I think you might want to move them above the Power ON line, up with the other hardware settings.

@timogoebel
Copy link
Member Author

@domcleal: Thanks for reviewing! I added the suggested changes. :-)

@@ -13,6 +13,8 @@
<%= select_f f, :guest_id, compute_resource.guest_types, :first, :last, {}, { :label => _("Guest OS"), :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :scsi_controller_type, compute_resource.scsi_controller_types, :first, :last, {}, { :label => _("SCSI controller"), :class => "col-md-2", :disabled => !new_host } %>
<%= select_f f, :hardware_version, compute_resource.vm_hw_versions, :first, :last, {}, { :label => _("Virtual H/W version"), :class => "col-md-2", :disabled => !new_host } %>
<%= checkbox_f f, :memoryHotAddEnabled, { :help_inline => _("Enable memory hot add"), :label => _('Memory hot add'), :label_size => "col-md-2", :disabled => !new_host } if new_host %>
Copy link
Contributor

Choose a reason for hiding this comment

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

is the if new_host required? If removed, will it show the current value of the setting when you edit the host, or will it only work during creation?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does pick up the current value, removed the requirement.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah great. Now I see what it looks like, you might want to get rid of the help_inline, since it's just a copy of the text - unless there's something more to say.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, updated the help text to actually say something. Thanks for the hint.
image

@domcleal
Copy link
Contributor

@shlomizadok would you mind testing this out?

@timogoebel timogoebel force-pushed the feature_vsphere_hot_add branch 2 times, most recently from afdacdd to d0b5874 Compare November 12, 2015 09:53
@brandonweeks
Copy link
Member

@domcleal we're a VMware environment, if you want me to take a look.

@mmoll
Copy link
Contributor

mmoll commented Nov 14, 2015

@brandonweeks testing is always appreciated 💯

@domcleal
Copy link
Contributor

@brandonweeks indeed, as Michael said, that'd be great. Confirmation that it works, makes sense, also works still with it off is needed.

@shlomizadok
Copy link
Member

I'm sorry, it is not working for me...
Selected Hot add...
image
However, in the vSphere web UI they are not enabled:
image
Nor:
image

(I am using vSphere 5.5)

@timogoebel
Copy link
Member Author

@shlomizadok : Thanks for testing. This actually should work fine as we just deployed 200 VMs with this settings and they were picked up. However you need to select a supported Guest OS I think (e.g. RHEL 7).

@marcohelmerich: Can you confirm?

Sorry for posting this in German:

image

@timogoebel
Copy link
Member Author

I just fixed the broken indent of the "Start" option...

@marcohelmerich
Copy link

If CPU and Memory Hot Plug is available for VMs depends on kernel support of that feature.
afaik VMWare uses the GuesOS type to deduce if the feature is supported by an OS.

feature.http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2020993

https://communities.vmware.com/message/1276213

@shlomizadok
Copy link
Member

Chose RHEL-6 64-bit. Still not working for me 😿
There is support for hot-plugs on my vSphere, as I have created a vm on vSphere with the same parameters / OS, and was able to add hot plug.

@marcohelmerich
Copy link

Hmm, running out of ideas at the momen. Do you use the same user for manual and foreman-deployment?

vsphere Docu:
cpuHotAddEnabled* xsd:boolean
Indicates whether or not virtual processors can be added to the virtual machine while it is running. This attribute can only be set when the virtual machine is powered-off.
Reconfigure privilege: VirtualMachine.Config.CpuCount

Since vSphere API 4.0

That is pretty straightforward. There is not much room for doing anything wrong...

@domcleal
Copy link
Contributor

Chose RHEL-6 64-bit. Still not working for me

Above, @timogoebel suggested RHEL 7 as the OS type, have you tried that?

@timogoebel
Copy link
Member Author

@domcleal : I think, that should not make any difference. Give me a sec to test this...

@timogoebel
Copy link
Member Author

@shlomizadok: I tested this again. Everything works like a charm. We basically just pass the correct options to fog.

When I update the settings through vSphere GUI, they are updated in Foreman accordingly.
When I create a new VM in Foreman, the settings are shown correctly in vSphere GUI and vSphere API.

image

@shlomizadok
Copy link
Member

👍 works great.
(Had to restart my buggy vSphere env and it works)
ACK to merge.

@marcohelmerich
Copy link

Great, we double checked everything and couldn't find an error :-)

@dLobatog
Copy link
Member

Merged as 4d695c3, thanks @timogoebel!

@dLobatog dLobatog closed this Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants