217
217
def prepare(self, memory_mb, packages, databases, users,
218
218
device_path='/dev/vdb', mount_point='/mnt/volume',
219
219
backup_info=None, config_contents=None, root_password=None,
220
overrides=None, cluster_config=None):
220
overrides=None, cluster_config=None, snapshot=None):
221
221
"""Make an asynchronous call to prepare the guest
222
222
as a database container optionally includes a backup id for restores
236
236
device_path=device_path, mount_point=mount_point,
237
237
backup_info=backup_info, config_contents=config_contents,
238
238
root_password=root_password, overrides=overrides,
239
cluster_config=cluster_config)
239
cluster_config=cluster_config, snapshot=snapshot)
241
241
def _create_guest_queue(self):
242
242
"""Call to construct, start and immediately stop rpc server in order
354
354
self._cast("attach_replication_slave", self.version_cap,
355
355
snapshot=snapshot, slave_config=replica_config)
357
def detach_replica(self):
357
def detach_replica(self, for_failover=False):
358
358
LOG.debug("Detaching replica %s from its replication source.", self.id)
359
359
return self._call("detach_replica", AGENT_HIGH_TIMEOUT,
360
self.version_cap, for_failover=for_failover)
362
def get_replica_context(self):
363
LOG.debug("Getting replica context.")
364
return self._call("get_replica_context",
365
AGENT_HIGH_TIMEOUT, self.version_cap)
367
def attach_replica(self, replica_info, slave_config):
368
LOG.debug("Attaching replica %s." % replica_info)
369
self._call("attach_replica", AGENT_HIGH_TIMEOUT, self.version_cap,
370
replica_info=replica_info, slave_config=slave_config)
372
def make_read_only(self, read_only):
373
LOG.debug("Executing make_read_only(%s)" % read_only)
374
self._call("make_read_only", AGENT_HIGH_TIMEOUT, self.version_cap,
377
def enable_as_master(self, replica_source_config):
378
LOG.debug("Executing enable_as_master")
379
self._call("enable_as_master", AGENT_HIGH_TIMEOUT, self.version_cap,
380
replica_source_config=replica_source_config)
382
# DEPRECATED: Maintain for API Compatibility
383
def get_txn_count(self):
384
LOG.debug("Executing get_txn_count.")
385
return self._call("get_txn_count",
386
AGENT_HIGH_TIMEOUT, self.version_cap)
388
def get_last_txn(self):
389
LOG.debug("Executing get_last_txn.")
390
return self._call("get_last_txn",
391
AGENT_HIGH_TIMEOUT, self.version_cap)
393
def get_latest_txn_id(self):
394
LOG.debug("Executing get_latest_txn_id.")
395
return self._call("get_latest_txn_id",
396
AGENT_HIGH_TIMEOUT, self.version_cap)
398
def wait_for_txn(self, txn):
399
LOG.debug("Executing wait_for_txn.")
400
self._call("wait_for_txn", AGENT_HIGH_TIMEOUT, self.version_cap,
362
403
def cleanup_source_on_replica_detach(self, replica_info):
363
404
LOG.debug("Cleaning up master %s on detach of replica.", self.id)