Revision cd42d0ad lib/hypervisor/hv_base.py

b/lib/hypervisor/hv_base.py
57 57
  def GetInstanceInfo(self, instance_name):
58 58
    """Get instance properties.
59 59

  
60
    @type instance_name: string
60 61
    @param instance_name: the instance name
61 62

  
62 63
    @return: tuple (name, id, memory, vcpus, state, times)
......
96 97
    """
97 98
    raise NotImplementedError
98 99

  
100
  def MigrationInfo(self, instance):
101
    """Get instance information to perform a migration.
102

  
103
    By default assume no information is needed.
104

  
105
    @type instance: L{objects.Instance}
106
    @param instance: instance to be migrated
107
    @rtype: string/data (opaque)
108
    @return: instance migration information - serialized form
109

  
110
    """
111
    return ''
112

  
113
  def AcceptInstance(self, instance, info, target):
114
    """Prepare to accept an instance.
115

  
116
    By default assume no preparation is needed.
117

  
118
    @type instance: L{objects.Instance}
119
    @param instance: instance to be accepted
120
    @type info: string/data (opaque)
121
    @param info: migration information, from the source node
122
    @type target: string
123
    @param target: target host (usually ip), on this node
124

  
125
    """
126
    pass
127

  
128
  def FinalizeMigration(self, instance, info, success):
129
    """Finalized an instance migration.
130

  
131
    Should finalize or revert any preparation done to accept the instance.
132
    Since by default we do no preparation, we also don't have anything to do
133

  
134
    @type instance: L{objects.Instance}
135
    @param instance: instance whose migration is being aborted
136
    @type info: string/data (opaque)
137
    @param info: migration information, from the source node
138
    @type success: boolean
139
    @param success: whether the migration was a success or a failure
140

  
141
    """
142
    pass
143

  
99 144
  def MigrateInstance(self, name, target, live):
100 145
    """Migrate an instance.
101 146

  
102
    Arguments:
103
      - name: the name of the instance
104
      - target: the target of the migration (usually will be IP and not name)
105
      - live: whether to do live migration or not
106

  
107
    Returns: none, errors will be signaled by exception.
147
    @type name: string
148
    @param name: name of the instance to be migrated
149
    @type target: string
150
    @param target: hostname (usually ip) of the target node
151
    @type live: boolean
152
    @param live: whether to do a live or non-live migration
108 153

  
109 154
    """
110 155
    raise NotImplementedError
111 156

  
112

  
113 157
  @classmethod
114 158
  def CheckParameterSyntax(cls, hvparams):
115 159
    """Check the given parameters for validity.

Also available in: Unified diff