cfme.infrastructure.virtual_machines module

A model of Infrastructure Virtual Machines area of CFME. This includes the VMs explorer tree, quadicon lists, and VM details page.

class cfme.infrastructure.virtual_machines.ArchiveDetails(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmDetailsView

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.

resetter(*args, **kwargs)[source]
step()[source]
class cfme.infrastructure.virtual_machines.Genealogy(obj)[source]

Bases: object

Class, representing genealogy of an infra object with possibility of data retrieval and comparison.

Parameters:o – The Vm or Template object.
ancestors

Returns list of ancestors of the represented object.

attr_mapping = {'all': 'All Attributes', 'different': 'Attributes with different values', 'same': 'Attributes with same values'}
compare(*objects, **kwargs)[source]

Compares two or more objects in the genealogy.

Parameters:*objectsVm or Template or str with name.
Keywords:
sections: Which sections to compare. attributes: all, different or same. Default: all. mode: exists or details. Default: exists.
mode_mapping = {'details': 'Details Mode', 'exists': 'Exists Mode'}
navigate()[source]
tree

Returns contents of the tree with genealogy

class cfme.infrastructure.virtual_machines.HostTemplatesOnlyAllView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.TemplatesOnlyAllView

adv_search_clear
entities
is_displayed
paginator
class cfme.infrastructure.virtual_machines.InfraGenericDetailsToolbar(*args, **kwargs)[source]

Bases: widgetastic.widget.View

configuration

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

custom_button

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

download

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

lifecycle

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

monitoring

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

policy

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

reload

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmDetailsToolbar(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraGenericDetailsToolbar

Toolbar for VM details differs from All VMs&TemplatesView

access

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

power

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmDetailsView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

TemplatesToolbar = None
VmsToolbar = None
entities

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

is_displayed
sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

Conditional switchable view implementation.

This widget proxy is useful when you have a form whose parts displayed depend on certain conditions. Eg. when you select certain value from a dropdown, one form is displayed next, when other value is selected, a different form is displayed next. This widget proxy is designed to register those multiple views and then upon accessing decide which view to use based on the registration conditions.

The resulting widget proxy acts similarly like a nested view (if you use view of course).

Example

class SomeForm(View):
    foo = Input('...')
    action_type = Select(name='action_type')

    action_form = ConditionalSwitchableView(reference='action_type')

    # Simple value matching. If Action type 1 is selected in the select, use this view.
    # And if the action_type value does not get matched, use this view as default
    @action_form.register('Action type 1', default=True)
    class ActionType1Form(View):
        widget = Widget()

    # You can use a callable to declare the widget values to compare
    @action_form.register(lambda action_type: action_type == 'Action type 2')
    class ActionType2Form(View):
        widget = Widget()

    # With callable, you can use values from multiple widgets
    @action_form.register(
        lambda action_type, foo: action_type == 'Action type 2' and foo == 2)
    class ActionType2Form(View):
        widget = Widget()

You can see it gives you the flexibility of decision based on the values in the view.

Parameters:
  • reference – For using non-callable conditions, this must be specified. Specifies the name of the widget whose value will be used for comparing non-callable conditions. Supports going across objects using ..
  • ignore_bad_reference – If this is enabled, then when the widget representing the reference is not displayed or otherwise broken, it will then use the default view.
class cfme.infrastructure.virtual_machines.InfraVmGenealogyToolbar(*args, **kwargs)[source]

Bases: widgetastic.widget.View

The toolbar on the genalogy page

compare

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

edit_tags

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

history

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

reload

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmGenealogyView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

The Genealogy page

is_displayed

Is this view being displayed

sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

tree

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmReconfigureView(*args, **kwargs)[source]

Bases: cfme.base.login.BaseLoggedInPage

affected_vms

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

cancel_button

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

cores_per_socket

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

cpu

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

cpu_total

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

disks_table

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

is_displayed
mem_size

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

mem_size_unit

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

memory

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

sockets

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

submit_button

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmSnapshotAddView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

Add a snapshot

cancel

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

create

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

description

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

is_displayed

Is this view being displayed

name

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

snapshot_vm_memory

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmSnapshotToolbar(*args, **kwargs)[source]

Bases: widgetastic.widget.View

The toolbar on the snapshots page

create

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

delete

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

history

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

reload

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

revert

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmSnapshotView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

The Snapshots page

description

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

is_displayed

Is this view being displayed

sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

tree

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmSummaryView(*args, **kwargs)[source]

Bases: cfme.common.vm_views.VMDetailsEntities

datastore_allocation

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

datastore_usage

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

operating_ranges

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.InfraVmTimelinesView(*args, **kwargs)[source]

Bases: widgetastic_manageiq.TimelinesView, cfme.infrastructure.virtual_machines.InfraVmView

is_displayed
class cfme.infrastructure.virtual_machines.InfraVmView(*args, **kwargs)[source]

Bases: cfme.base.login.BaseLoggedInPage

Base view for header/nav check, inherit for navigatable views

in_infra_vms
class cfme.infrastructure.virtual_machines.ProviderTemplatesOnlyAllView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.TemplatesOnlyAllView

adv_search_clear
entities
is_displayed
paginator
class cfme.infrastructure.virtual_machines.ProvisionVM(obj, navigate_obj)[source]

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

VIEW

alias of ProvisionView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.SetOwnership(obj, navigate_obj)[source]

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

VIEW

alias of SetOwnershipView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.SetRetirement(obj, navigate_obj)[source]

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

VIEW
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(*args, **kwargs)[source]
view_classes()[source]
class cfme.infrastructure.virtual_machines.Template(name, provider, template_name=None)[source]

Bases: cfme.common.vm.Template

REMOVE_MULTI = 'Remove Templates from the VMDB'
genealogy
class cfme.infrastructure.virtual_machines.TemplatesAll(obj, navigate_obj)[source]

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

VIEW

alias of TemplatesOnlyAllView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.TemplatesOnlyAllView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

adv_search_clear
entities
is_displayed
paginator
sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

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

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

VIEW

alias of InfraVmTimelinesView

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.virtual_machines.VMConfiguration(vm)[source]

Bases: cfme.utils.pretty.Pretty

Represents VM’s full configuration - hardware, disks and so forth

Parameters:vm – VM that exists within current appliance

Note

It can be only instantiated by fetching an existing VM’s configuration, as it is designed to be used to reconfigure an existing VM.

add_disk(size, size_unit='GB', type='thin', mode='persistent')[source]

Adds a disk to the VM

Parameters:
  • size – Size of the disk
  • size_unit – Unit of size (‘MB’ or ‘GB’)
  • type – Type of the disk (‘thin’ or ‘thick’)
  • mode – Mode of the disk (‘persistent’, ‘independent_persistent’ or ‘independent_nonpersistent’)

Note

This method is designed to correspond with the DB, not with the UI. In the UI, dependency is represented by a separate Yes / No option which is _incorrect_ design that we don’t follow. Correctly, mode should be a selectbox of 3 items: Persistent, Independent Persistent and Independent Nonpersistent. Just Nonpersistent is an invalid setup that UI currently (5.8) allows.

copy()[source]

Returns a copy of this configuration

delete_disk(filename=None, index=None)[source]

Removes a disk of given filename or index

get_changes_to_fill(other_configuration)[source]

Returns changes to be applied to this config to reach the other config

Note

Result of this method is used for form filling by VM’s reconfigure method.

num_disks
pretty_attrs = ['hw', 'num_disks']
class cfme.infrastructure.virtual_machines.VMDisk[source]

Bases: cfme.infrastructure.virtual_machines.VMDisk

Represents a single VM disk

Note

Cannot be changed once created.

EQUAL_ATTRS = set(['size_mb', 'type', 'mode'])
size_mb
class cfme.infrastructure.virtual_machines.VMHardware(cores_per_socket=None, sockets=None, mem_size=None, mem_size_unit='MB')[source]

Bases: object

Represents VM’s hardware, i.e. CPU (cores, sockets) and memory

EQUAL_ATTRS = set(['mem_size_mb', 'cores_per_socket', 'sockets'])
mem_size_mb
class cfme.infrastructure.virtual_machines.Vm(name, provider, template_name=None, appliance=None)[source]

Bases: cfme.common.vm.VM

Represents a VM in CFME

Parameters:
  • name – Name of the VM
  • provider_crudcfme.cloud.provider.Provider object
  • template_name – Name of the template to use for provisioning
ALL_LIST_LOCATION = 'infra_vms'
class CfmeRelationship(vm)[source]

Bases: object

get_relationship()[source]
is_relationship_set()[source]
navigate()[source]
set_relationship(server_name, server_id, click_cancel=False)[source]
Vm.DETAILS_VIEW_CLASS

alias of InfraVmDetailsView

Vm.GUEST_RESTART = 'Restart Guest'
Vm.GUEST_SHUTDOWN = 'Shutdown Guest'
Vm.POWER_OFF = 'Power Off'
Vm.POWER_ON = 'Power On'
Vm.RESET = 'Reset'
Vm.STATE_OFF = 'off'
Vm.STATE_ON = 'on'
Vm.STATE_SUSPENDED = 'suspended'
Vm.SUSPEND = 'Suspend'
class Vm.Snapshot(name=None, description=None, memory=None, parent_vm=None)[source]

Bases: object

active

Check if the snapshot is active.

Returns:True if snapshot is active, False otherwise.
Return type:bool
create(force_check_memory=False)[source]

Create a snapshot

delete(cancel=False)[source]
delete_all(cancel=False)[source]
exists
refresh()[source]
revert_to(cancel=False)[source]
snapshot_tree

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

Vm.TO_OPEN_EDIT = 'Edit this VM'
Vm.TO_OPEN_RECONFIGURE = 'Reconfigure this VM'
Vm.TO_RETIRE = 'Retire this VM'
Vm.VM_TYPE = 'Virtual Machine'
Vm.clone_vm(email=None, first_name=None, last_name=None, vm_name=None, provision_type=None)[source]
Vm.cluster
Vm.cluster_id

returns id of cluster current vm belongs to

Vm.configuration
Vm.current_snapshot_description

Returns the current snapshot description.

Vm.current_snapshot_name

Returns the current snapshot name.

Vm.genealogy
Vm.get_collection_via_rest()[source]
Vm.get_vm_via_rest()[source]
Vm.host
Vm.migrate_vm(email=None, first_name=None, last_name=None, host_name=None, datastore_name=None)[source]
Vm.power_control_from_provider(option)[source]

Power control a vm from the provider

Parameters:option – power control action to take against vm
Raises:OptionNotAvailable – option parm must have proper value
Vm.publish_to_template(template_name, email=None, first_name=None, last_name=None)[source]
Vm.reconfigure(new_configuration=None, changes=None, cancel=False)[source]

Reconfigures the VM based on given configuration or set of changes

Parameters:
  • new_configuration – VMConfiguration object with desired configuration
  • changes – Set of changes to request; alternative to new_configuration See VMConfiguration.get_changes_to_fill to see expected format of the data
  • cancelFalse if we want to submit the changes, True otherwise
Vm.total_snapshots

Returns the number of snapshots for this VM. If it says None, returns 0.

class cfme.infrastructure.virtual_machines.VmAll(obj, navigate_obj)[source]

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

VIEW

alias of VmsOnlyAllView

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.

resetter(*args, **kwargs)[source]
step(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmAllWithTemplates(obj, navigate_obj)[source]

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

VIEW

alias of VmsTemplatesAllView

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.

resetter(*args, **kwargs)[source]
step()[source]
class cfme.infrastructure.virtual_machines.VmAllWithTemplatesDetails(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmDetailsView

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.

resetter(*args, **kwargs)[source]
step()[source]
class cfme.infrastructure.virtual_machines.VmAllWithTemplatesDetailsAnyProvider(obj, navigate_obj)[source]

Bases: cfme.infrastructure.virtual_machines.VmAllWithTemplatesDetails

Page with details for VM or template. This is required in case you want to get details about archived/orphaned VM/template. In such case, you cannot get to the detail page by navigating from list of VMs for a provider since archived/orphaned VMs has lost its relationship with the original provider.

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.

class cfme.infrastructure.virtual_machines.VmAllWithTemplatesForProvider(obj, navigate_obj)[source]

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

VIEW

alias of VmTemplatesAllForProviderView

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.

resetter(*args, **kwargs)[source]
step(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmClone(obj, navigate_obj)[source]

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

VIEW

alias of CloneVmView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmDetails(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmDetailsView

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.

resetter(*args, **kwargs)[source]
step(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmEdit(obj, navigate_obj)[source]

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

VIEW

alias of EditView

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.virtual_machines.VmEngineRelationship(obj, navigate_obj)[source]

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

VIEW

alias of ManagementEngineView

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.virtual_machines.VmGenealogyAll(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmGenealogyView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmMigrate(obj, navigate_obj)[source]

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

VIEW

alias of MigrateVmView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmReconfigure(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmReconfigureView

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.virtual_machines.VmSnapshotsAdd(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmSnapshotAddView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmSnapshotsAll(obj, navigate_obj)[source]

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

VIEW

alias of InfraVmSnapshotView

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(*args, **kwargs)[source]
class cfme.infrastructure.virtual_machines.VmTemplatesAllForProviderView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

adv_search_clear
entities
is_displayed
paginator
reset_page(*args, **kwargs)[source]
sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.VmsOnlyAllView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

adv_search_clear
entities
is_displayed
paginator
reset_page(*args, **kwargs)[source]
sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.VmsTemplatesAccordion(*args, **kwargs)[source]

Bases: widgetastic.widget.View

The accordion on the Virtual Machines page

templates

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

vms

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

vmstemplates

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.infrastructure.virtual_machines.VmsTemplatesAllView(*args, **kwargs)[source]

Bases: cfme.infrastructure.virtual_machines.InfraVmView

The collection page for instances

actions

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

adv_search_clear
entities
is_displayed
pagination

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

paginator
reset_page(*args, **kwargs)[source]
sidebar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

toolbar

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

cfme.infrastructure.virtual_machines.do_power_control(vm_names, option, provider_crud=None, cancel=True)[source]

Executes a power option against a list of VMs.

Parameters:
  • vm_names – List of VMs to interact with
  • option – Power option param.
  • provider_crud – provider object where vm resides on (optional)
  • cancel – Whether or not to cancel the power control action
cfme.infrastructure.virtual_machines.find_path(tree, text, parent_item=None)[source]

Find the path to an item with text

cfme.infrastructure.virtual_machines.find_quadicon(vm_name)[source]

Find and return a quadicon belonging to a specific vm

Parameters:vm – vm name as displayed at the quadicon

Returns: entity of appropriate class

cfme.infrastructure.virtual_machines.get_all_vms(do_not_navigate=False)[source]

Returns list of all vms on current page

cfme.infrastructure.virtual_machines.get_number_of_vms(do_not_navigate=False)[source]

Returns the total number of VMs visible to the user, including those archived or orphaned

cfme.infrastructure.virtual_machines.has_child(tree, text, parent_item=None)[source]

Check if a tree has an item with text

cfme.infrastructure.virtual_machines.is_pwr_option_enabled(vm_names, option, provider_crud=None)[source]

Returns whether a particular power option is enabled.

Parameters:
  • vm_names – List of VMs to interact with
  • provider_crud – provider object where vm resides on (optional)
  • option – Power option param.
Raises:

NoOptionAvailable

When unable to find the power option passed

cfme.infrastructure.virtual_machines.is_pwr_option_visible(vm_names, option, provider_crud=None)[source]

Returns whether a particular power option is visible.

Parameters:
  • vm_names – List of VMs to interact with, if from_details=True is passed, only one VM can be passed in the list.
  • option – Power option param.
  • provider_crud – provider object where vm resides on (optional)
cfme.infrastructure.virtual_machines.perform_smartstate_analysis(vm_names, provider_crud=None, cancel=True)[source]

Executes a refresh relationships action against a list of VMs.

Parameters:
  • vm_names – List of VMs to interact with
  • provider_crud – provider object where vm resides on (optional)
  • cancel – Whether or not to cancel the refresh relationships action
cfme.infrastructure.virtual_machines.remove(vm_names, cancel=True, provider_crud=None)[source]

Removes multiple VMs from CFME VMDB

Parameters:
  • vm_names – List of VMs to interact with
  • cancel – Whether to cancel the deletion, defaults to True
  • provider_crud – provider object where vm resides on (optional)
cfme.infrastructure.virtual_machines.wait_for_vm_state_change(vm_name, desired_state, timeout=300, provider_crud=None)[source]

Wait for VM to come to desired state.

This function waits just the needed amount of time thanks to wait_for.

Parameters:
  • vm_name – Displayed name of the VM
  • desired_state – ‘on’ or ‘off’
  • timeout – Specify amount of time (in seconds) to wait until TimedOutError is raised
  • provider_crud – provider object where vm resides on (optional)