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

No need to restart the VM if the config was not updated #82

Merged
merged 1 commit into from
Sep 7, 2018

Conversation

psiroky
Copy link

@psiroky psiroky commented Sep 6, 2018

In order to apply the cpu mode="host-passthrough" config to the VM, one needs
to stop the VM first. That was the case before, every time. However, at
least on Fedora, the cpu mode="host-passthrough" is configured by
default and thus there is no need to actually update the config and then
restart the VM. This considerably speeds up the the process.

Note about the setup_minishift and start_minishift flag values - there
are four possible cases:

  1. 'setup_minishift == true and start_minishift == true' --- this will
    result in creating and initializing brand new minishift profile, which
    will be running after the init is done.

  2. 'setup_minishift == true and start_minishift == false' --- this will
    result in creating and initializing brand new minishift profile,
    but it will be stopped at the end (as start_minishift == false).
    It may well be started again by e.g. the os_temps role which
    usually comes after the minishift role.

  3. 'setup_minishift == false and start_minishift == true' --- this
    won't initialize (create) the VM at all. The VM is expected to be
    created before running contra-env-setup. The VM will, however, be
    started at the end (in case it's not already running).

  4. 'setup_minishift == false and start_minishift == false' --- this
    won't do minishift operations at all. This combination is useful
    for deploying into remote OpenShift clusters.

@psiroky psiroky requested a review from arilivigni September 6, 2018 12:43
@dirgim
Copy link
Contributor

dirgim commented Sep 6, 2018

This looks good to me - I would just add that this change enables usage of the 1st case (both setup_minishift and start_minishift set to true), and only in that case is the minishift stop skipped - meaning that this doesn't affect running the contra-env-setup with the default options (the 2nd case), except for the better check for the host-passthrough option.


- name: Wait for the cluster to come up completely
- name: "Check if <cpu mode=host-passthrough/> is already set"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to put these tasks in a block that only has the 1 linux check vs having that check 4 separate times?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that sounds reasonable. Will fix it.

In order to apply the cpu mode="host-passthrough" config to the VM, one needs
to stop the VM first. That was the case before, every time. However, at
least on Fedora, the cpu mode="host-passthrough" is configured by
default and thus there is no need to actually update the config and then
restart the VM. This considerably speeds up the the process.

Note about the setup_minishift and start_minishift flag values - there
are four possible cases:
  1) 'setup_minishift == true and start_minishift == true' --- this will
     result in creating and initializing brand new minishift profile, which
     will be running after the init is done.

  2) 'setup_minishift == true and start_minishift == false' --- this will
     result in creating and initializing brand new minishift profile,
     but it will be stopped at the end (as start_minishift == false).
     It may well be started again by e.g. the os_temps role which
     usually comes after the minishift role.

  3) 'setup_minishift == false and start_minishift == true' --- this
     won't initialize (create) the VM at all. The VM is expected to be
     created before running contra-env-setup. The VM will, however, be
     started at the end (in case it's not already running).

  4) 'setup_minishift == false and start_minishift == false' --- this
     won't do minishift operations at all. This combination is useful
     for deploying into remote OpenShift clusters.
Copy link
Member

@arilivigni arilivigni left a comment

Choose a reason for hiding this comment

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

LGTM

@arilivigni arilivigni merged commit 8f07025 into CentOS-PaaS-SIG:master Sep 7, 2018
@psiroky psiroky deleted the check-cpu-mode branch September 7, 2018 15:12
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.

4 participants