mgn / Client / disconnect_from_service

disconnect_from_service

mgn.Client.disconnect_from_service(**kwargs)

Disconnects specific Source Servers from Application Migration Service. Data replication is stopped immediately. All AWS resources created by Application Migration Service for enabling the replication of these source servers will be terminated / deleted within 90 minutes. Launched Test or Cutover instances will NOT be terminated. If the agent on the source server has not been prevented from communicating with the Application Migration Service service, then it will receive a command to uninstall itself (within approximately 10 minutes). The following properties of the SourceServer will be changed immediately: dataReplicationInfo.dataReplicationState will be set to DISCONNECTED; The totalStorageBytes property for each of dataReplicationInfo.replicatedDisks will be set to zero; dataReplicationInfo.lagDuration and dataReplicationInfo.lagDuration will be nullified.

See also: AWS API Documentation

Request Syntax

response = client.disconnect_from_service(
    sourceServerID='string',
    accountID='string'
)
Parameters:
  • sourceServerID (string) –

    [REQUIRED]

    Request to disconnect Source Server from service by Server ID.

  • accountID (string) – Request to disconnect Source Server from service by Account ID.

Return type:

dict

Returns:

Response Syntax

{
    'sourceServerID': 'string',
    'arn': 'string',
    'isArchived': True|False,
    'tags': {
        'string': 'string'
    },
    'launchedInstance': {
        'ec2InstanceID': 'string',
        'jobID': 'string',
        'firstBoot': 'WAITING'|'SUCCEEDED'|'UNKNOWN'|'STOPPED'
    },
    'dataReplicationInfo': {
        'lagDuration': 'string',
        'etaDateTime': 'string',
        'replicatedDisks': [
            {
                'deviceName': 'string',
                'totalStorageBytes': 123,
                'replicatedStorageBytes': 123,
                'rescannedStorageBytes': 123,
                'backloggedStorageBytes': 123
            },
        ],
        'dataReplicationState': 'STOPPED'|'INITIATING'|'INITIAL_SYNC'|'BACKLOG'|'CREATING_SNAPSHOT'|'CONTINUOUS'|'PAUSED'|'RESCAN'|'STALLED'|'DISCONNECTED'|'PENDING_SNAPSHOT_SHIPPING'|'SHIPPING_SNAPSHOT',
        'dataReplicationInitiation': {
            'startDateTime': 'string',
            'nextAttemptDateTime': 'string',
            'steps': [
                {
                    'name': 'WAIT'|'CREATE_SECURITY_GROUP'|'LAUNCH_REPLICATION_SERVER'|'BOOT_REPLICATION_SERVER'|'AUTHENTICATE_WITH_SERVICE'|'DOWNLOAD_REPLICATION_SOFTWARE'|'CREATE_STAGING_DISKS'|'ATTACH_STAGING_DISKS'|'PAIR_REPLICATION_SERVER_WITH_AGENT'|'CONNECT_AGENT_TO_REPLICATION_SERVER'|'START_DATA_TRANSFER',
                    'status': 'NOT_STARTED'|'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'SKIPPED'
                },
            ]
        },
        'dataReplicationError': {
            'error': 'AGENT_NOT_SEEN'|'SNAPSHOTS_FAILURE'|'NOT_CONVERGING'|'UNSTABLE_NETWORK'|'FAILED_TO_CREATE_SECURITY_GROUP'|'FAILED_TO_LAUNCH_REPLICATION_SERVER'|'FAILED_TO_BOOT_REPLICATION_SERVER'|'FAILED_TO_AUTHENTICATE_WITH_SERVICE'|'FAILED_TO_DOWNLOAD_REPLICATION_SOFTWARE'|'FAILED_TO_CREATE_STAGING_DISKS'|'FAILED_TO_ATTACH_STAGING_DISKS'|'FAILED_TO_PAIR_REPLICATION_SERVER_WITH_AGENT'|'FAILED_TO_CONNECT_AGENT_TO_REPLICATION_SERVER'|'FAILED_TO_START_DATA_TRANSFER'|'UNSUPPORTED_VM_CONFIGURATION'|'LAST_SNAPSHOT_JOB_FAILED',
            'rawError': 'string'
        },
        'lastSnapshotDateTime': 'string',
        'replicatorId': 'string'
    },
    'lifeCycle': {
        'addedToServiceDateTime': 'string',
        'firstByteDateTime': 'string',
        'elapsedReplicationDuration': 'string',
        'lastSeenByServiceDateTime': 'string',
        'lastTest': {
            'initiated': {
                'apiCallDateTime': 'string',
                'jobID': 'string'
            },
            'reverted': {
                'apiCallDateTime': 'string'
            },
            'finalized': {
                'apiCallDateTime': 'string'
            }
        },
        'lastCutover': {
            'initiated': {
                'apiCallDateTime': 'string',
                'jobID': 'string'
            },
            'reverted': {
                'apiCallDateTime': 'string'
            },
            'finalized': {
                'apiCallDateTime': 'string'
            }
        },
        'state': 'STOPPED'|'NOT_READY'|'READY_FOR_TEST'|'TESTING'|'READY_FOR_CUTOVER'|'CUTTING_OVER'|'CUTOVER'|'DISCONNECTED'|'DISCOVERED'|'PENDING_INSTALLATION'
    },
    'sourceProperties': {
        'lastUpdatedDateTime': 'string',
        'recommendedInstanceType': 'string',
        'identificationHints': {
            'fqdn': 'string',
            'hostname': 'string',
            'vmWareUuid': 'string',
            'awsInstanceID': 'string',
            'vmPath': 'string'
        },
        'networkInterfaces': [
            {
                'macAddress': 'string',
                'ips': [
                    'string',
                ],
                'isPrimary': True|False
            },
        ],
        'disks': [
            {
                'deviceName': 'string',
                'bytes': 123
            },
        ],
        'cpus': [
            {
                'cores': 123,
                'modelName': 'string'
            },
        ],
        'ramBytes': 123,
        'os': {
            'fullString': 'string'
        }
    },
    'replicationType': 'AGENT_BASED'|'SNAPSHOT_SHIPPING',
    'vcenterClientID': 'string',
    'applicationID': 'string',
    'userProvidedID': 'string',
    'fqdnForActionFramework': 'string',
    'connectorAction': {
        'credentialsSecretArn': 'string',
        'connectorArn': 'string'
    }
}

Response Structure

  • (dict) –

    • sourceServerID (string) –

      Source server ID.

    • arn (string) –

      Source server ARN.

    • isArchived (boolean) –

      Source server archived status.

    • tags (dict) –

      Source server Tags.

      • (string) –

        • (string) –

    • launchedInstance (dict) –

      Source server launched instance.

      • ec2InstanceID (string) –

        Launched instance EC2 ID.

      • jobID (string) –

        Launched instance Job ID.

      • firstBoot (string) –

        Launched instance first boot.

    • dataReplicationInfo (dict) –

      Source server data replication info.

      • lagDuration (string) –

        Request to query data replication lag duration.

      • etaDateTime (string) –

        Request to query the time when data replication will be complete.

      • replicatedDisks (list) –

        Request to query disks replicated.

        • (dict) –

          Request to query disks replicated.

          • deviceName (string) –

            Request to query device name.

          • totalStorageBytes (integer) –

            Request to query total amount of data replicated in bytes.

          • replicatedStorageBytes (integer) –

            Request to query amount of data replicated in bytes.

          • rescannedStorageBytes (integer) –

            Request to query amount of data rescanned in bytes.

          • backloggedStorageBytes (integer) –

            Request to query data replication backlog size in bytes.

      • dataReplicationState (string) –

        Request to query the data replication state.

      • dataReplicationInitiation (dict) –

        Request to query whether data replication has been initiated.

        • startDateTime (string) –

          Request to query data initiation start date and time.

        • nextAttemptDateTime (string) –

          Request to query next data initiation date and time.

        • steps (list) –

          Request to query data initiation steps.

          • (dict) –

            Data replication initiation step.

            • name (string) –

              Request to query data initiation step name.

            • status (string) –

              Request to query data initiation status.

      • dataReplicationError (dict) –

        Error in obtaining data replication info.

        • error (string) –

          Error in data replication.

        • rawError (string) –

          Error in data replication.

      • lastSnapshotDateTime (string) –

        Request to query data replication last snapshot time.

      • replicatorId (string) –

        Replication server instance ID.

    • lifeCycle (dict) –

      Source server lifecycle state.

      • addedToServiceDateTime (string) –

        Lifecycle added to service data and time.

      • firstByteDateTime (string) –

        Lifecycle replication initiation date and time.

      • elapsedReplicationDuration (string) –

        Lifecycle elapsed time and duration.

      • lastSeenByServiceDateTime (string) –

        Lifecycle last seen date and time.

      • lastTest (dict) –

        Lifecycle last Test.

        • initiated (dict) –

          Lifecycle last Test initiated.

          • apiCallDateTime (string) –

            Lifecycle last Test initiated API call date and time.

          • jobID (string) –

            Lifecycle last Test initiated Job ID.

        • reverted (dict) –

          Lifecycle last Test reverted.

          • apiCallDateTime (string) –

            Lifecycle last Test reverted API call date and time.

        • finalized (dict) –

          Lifecycle last Test finalized.

          • apiCallDateTime (string) –

            Lifecycle Test failed API call date and time.

      • lastCutover (dict) –

        Lifecycle last Cutover.

        • initiated (dict) –

          Lifecycle last Cutover initiated.

          • apiCallDateTime (string) –

          • jobID (string) –

            Lifecycle last Cutover initiated by Job ID.

        • reverted (dict) –

          Lifecycle last Cutover reverted.

          • apiCallDateTime (string) –

            Lifecycle last Cutover reverted API call date time.

        • finalized (dict) –

          Lifecycle Cutover finalized date and time.

          • apiCallDateTime (string) –

            Lifecycle Cutover finalized date and time.

      • state (string) –

        Lifecycle state.

    • sourceProperties (dict) –

      Source server properties.

      • lastUpdatedDateTime (string) –

        Source server last update date and time.

      • recommendedInstanceType (string) –

        Source server recommended instance type.

      • identificationHints (dict) –

        Source server identification hints.

        • fqdn (string) –

          FQDN address identification hint.

        • hostname (string) –

          Hostname identification hint.

        • vmWareUuid (string) –

          vmWare UUID identification hint.

        • awsInstanceID (string) –

          AWS Instance ID identification hint.

        • vmPath (string) –

          vCenter VM path identification hint.

      • networkInterfaces (list) –

        Source server network interfaces.

        • (dict) –

          Network interface.

          • macAddress (string) –

            Network interface Mac address.

          • ips (list) –

            Network interface IPs.

            • (string) –

          • isPrimary (boolean) –

            Network interface primary IP.

      • disks (list) –

        Source Server disks.

        • (dict) –

          The disk identifier.

          • deviceName (string) –

            The disk or device name.

          • bytes (integer) –

            The amount of storage on the disk in bytes.

      • cpus (list) –

        Source Server CPUs.

        • (dict) –

          Source server CPU information.

          • cores (integer) –

            The number of CPU cores on the source server.

          • modelName (string) –

            The source server’s CPU model name.

      • ramBytes (integer) –

        Source server RAM in bytes.

      • os (dict) –

        Source server OS.

        • fullString (string) –

          OS full string.

    • replicationType (string) –

      Source server replication type.

    • vcenterClientID (string) –

      Source server vCenter client id.

    • applicationID (string) –

      Source server application ID.

    • userProvidedID (string) –

      Source server user provided ID.

    • fqdnForActionFramework (string) –

      Source server fqdn for action framework.

    • connectorAction (dict) –

      Source Server connector action.

      • credentialsSecretArn (string) –

        Source Server connector action credentials secret arn.

      • connectorArn (string) –

        Source Server connector action connector arn.

Exceptions

  • mgn.Client.exceptions.UninitializedAccountException

  • mgn.Client.exceptions.ResourceNotFoundException

  • mgn.Client.exceptions.ConflictException