cfme.infrastructure.host module

A model of an Infrastructure Host in CFME.

class cfme.infrastructure.host.Add(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostAddView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.All(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostsView

prerequisite

This is a helper descriptor for destinations which are linked to an attribute of the object.

For instance, imagine you have an object that has an attribute(parent) which has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToAttribute as a helper, supplying only the name of the attribute which stores the object to be used in the navigation, and the destination name. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.Details(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostDetailsView

prerequisite

This is a helper descriptor for destinations which are linked to an attribute of the object.

For instance, imagine you have an object that has an attribute(parent) which has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToAttribute as a helper, supplying only the name of the attribute which stores the object to be used in the navigation, and the destination name. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.Discover(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostDiscoverView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.Edit(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostEditView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.Host(parent, name, provider=None, hostname=None, ip_address=None, custom_ident=None, host_platform=None, ipmi_address=None, mac_address=None, credentials=NOTHING, ipmi_credentials=None, interface_type='lan')[source]

Bases: cfme.modeling.base.BaseEntity, cfme.utils.update.Updateable, cfme.utils.pretty.Pretty, cfme.common.PolicyProfileAssignable, cfme.common.Taggable

Model of an infrastructure host in cfme.

Parameters:
  • name – Name of the host.
  • hostname – Hostname of the host.
  • ip_address – The IP address as a string.
  • custom_ident – The custom identifiter.
  • host_platform – Included but appears unused in CFME at the moment.
  • ipmi_address – The IPMI address.
  • mac_address – The mac address of the system.
  • Combines three types of credentials - 'default', 'remote_login', (credentials) – ‘web_services’, all three can be passed. Each contains (Credential): see Credential inner class.
  • ipmi_credentials (Credential) – see Credential inner class.

Usage:

myhost = Host(name='vmware',
              credentials={
                        'default': Provider.Credential(principal='admin', secret='foobar')})
myhost.create()
class Credential(**kwargs)[source]

Bases: cfme.base.credential.Credential, cfme.utils.update.Updateable

Provider credentials

Parameters:**kwargs – If using IPMI type credential, ipmi = True
Host.__ge__(other)

Automatically created by attrs.

Host.__gt__(other)

Automatically created by attrs.

Host.__le__(other)

Automatically created by attrs.

Host.__lt__(other)

Automatically created by attrs.

Host.__ne__(other)

Check equality and either forward a NotImplemented or return the result negated.

Host.__repr__()

Automatically created by attrs.

Host.check_compliance(timeout=240)[source]

Initiates compliance check and waits for it to finish.

Host.compliance_status

Returns the title of the compliance SummaryTable. The title contains datetime so it can be compared.

Returns:NoneType if no title is present (no compliance checks before), otherwise str
Host.db_id = None
Host.delete(cancel=True)[source]

Deletes this host from CFME.

Parameters:cancel (bool) – Whether to cancel the deletion, defaults to True
Host.equal_drift_results(drift_section, section, *indexes)[source]

Compares drift analysis results of a row specified by it’s title text.

Parameters:
  • drift_section (str) – Title text of the row to compare
  • section (str) – Accordion section where the change happened
  • indexes – Indexes of results to compare starting with 0 for first row (latest result). Compares all available drifts, if left empty (default)

Note

There have to be at least 2 drift results available for this to work.

Returns:bool
Host.execute_button(button_group, button, handle_alert=False)[source]
Host.exists

Checks if the host exists in the UI.

Returns: bool

classmethod Host.get_credentials_from_config(credentials_config)[source]

Retrieves the credentials from the credentials yaml.

Parameters:credentials_config – a dict with host credentials in the credentials yaml.
Returns:A dict with credential types and cfme.base.credential.Credential instances
Host.get_datastores()[source]

Gets list of all datastores used by this host.

Returns: list of datastores names

Host.get_db_id
Host.get_ipmi()[source]
Host.get_power_state()[source]
Host.has_valid_credentials

Checks if host has valid credentials save.

Returns: bool

Host.is_compliant

Check if the Host is compliant.

Returns:bool
Host.load_details(refresh=False)[source]

To be compatible with the Taggable and PolicyProfileAssignable mixins.

Parameters:refresh (bool) – Whether to perform the page refresh, defaults to False
Host.power_off()[source]
Host.power_on()[source]
Host.pretty_attrs = ['name', 'hostname', 'ip_address', 'custom_ident']
Host.refresh(cancel=False)[source]

Perform ‘Refresh Relationships and Power States’ for the host.

Parameters:cancel (bool) – Whether the action should be cancelled, default to False
Host.run_smartstate_analysis(wait_for_task_result=False)[source]

Runs smartstate analysis on this host.

Note

The host must have valid credentials already set up for this to work.

Host.update(updates, validate_credentials=False)[source]

Updates a host in the UI. Better to use utils.update.update context manager than call this directly.

Parameters:updates (dict) – fields that are changing.
Host.update_credentials_rest(credentials)[source]

Updates host’s credentials via rest api

Parameters:credentials (dict) – credentials from yaml file

Returns: True if credentials are saved and valid; False otherwise

Host.wait_candu_data_available(timeout=900)[source]

Waits until C&U data are available for this Host

Parameters:timeout – Timeout passed to utils.wait.wait_for()
Host.wait_for_delete()[source]

Waits for the host to remove from the UI.

Host.wait_for_host_state_change(desired_state, timeout=300)[source]

Wait for Host to come to desired state. This function waits just the needed amount of time thanks to wait_for.

Parameters:
  • desired_state (str) – ‘on’ or ‘off’
  • timeout (int) – Specify amount of time (in seconds) to wait until TimedOutError is raised
Host.wait_to_appear()[source]

Waits for the host to appear in the UI.

class cfme.infrastructure.host.HostCollection(parent, filters=NOTHING)[source]

Bases: cfme.modeling.base.BaseCollection

Collection object for the cfme.infrastructure.host.Host.

ENTITY

alias of Host

__ge__(other)

Automatically created by attrs.

__gt__(other)

Automatically created by attrs.

__le__(other)

Automatically created by attrs.

__lt__(other)

Automatically created by attrs.

__ne__(other)

Check equality and either forward a NotImplemented or return the result negated.

__repr__()

Automatically created by attrs.

all(provider)[source]

returning all hosts objects

check_hosts(hosts)[source]
create(name, provider=None, credentials=None, hostname=None, ip_address=None, host_platform=None, custom_ident=None, ipmi_address=None, mac_address=None, ipmi_credentials=None, cancel=False, validate_credentials=False, interface_type='lan')[source]

Creates a host in the UI.

Parameters:
  • cancel (bool) – Whether to cancel out of the creation. The cancel is done after all the information present in the Host has been filled in the UI.
  • validate_credentials (bool) – Whether to validate credentials - if True and the credentials are invalid, an error will be raised.
create_from_config(host_key)[source]

Creates a Host object given a yaml entry in cfme_data.

Usage:

create_from_config('esx')

Returns: A Host object that has methods that operate on CFME

delete(*hosts)[source]

Deletes this host from CFME.

discover(from_address, to_address, esx=False, ipmi=False, cancel=False)[source]

Discovers hosts.

get_from_config(host_key)[source]

Creates a Host object given a yaml entry in cfme_data.

Usage:

get_from_config('esx')

Returns: A Host object that has methods that operate on CFME

power_off(*hosts)[source]
power_on(*hosts)[source]
run_smartstate_analysis(*hosts)[source]
class cfme.infrastructure.host.Provision(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.Timelines(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostTimelinesView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.host.Utilization(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of HostInfraUtilizationView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]