oracle / oci-cli

Command Line Interface for Oracle Cloud Infrastructure
https://cloud.oracle.com/cloud-infrastructure
Other
452 stars 186 forks source link

Cannot enable cross region replication #834

Open bogdan-m-darie opened 3 months ago

bogdan-m-darie commented 3 months ago

I have a volume group for which I want to enable cross region replication:

oci bv volume-group update --force --volume-group-id ocid1.volumegroup.oc1.eu-amsterdam-1.abqw2ljrf5trtq6v2u6a5allekc5kfmlnqogxkplyiy7fgungzzp6igote7a --volume-group-replicas '[{"availabilityDomain": "vuTf:EU-FRANKFURT-1-AD-1","displayname": "ams2fra"}]' --region eu-amsterdam-1 --debug

The command returns the following:

DEBUG:oci_cli.cli_util:Config File: dict_keys(['log_requests', 'additional_user_agent', 'pass_phrase', 'tenancy', 'user', 'fingerprint', 'key_file', 'region'])
DEBUG:oci_cli.cli_util:region: Environment Variable or Parameter
DEBUG:oci.base_client.139871058036064:Endpoint: https://iaas.eu-amsterdam-1.oraclecloud.com/20160918
INFO:oci.base_client.139871058036064: 2024-08-07 08:00:43.680427: Request: PUT https://iaas.eu-amsterdam-1.oraclecloud.com/20160918/volumeGroups/ocid1.volumegroup.oc1.eu-amsterdam-1.abqw2ljrf5trtq6v2u6a5allekc5kfmlnqogxkplyiy7fgungzzp6igote7a
Not using Expect header...
send: b'PUT /20160918/volumeGroups/ocid1.volumegroup.oc1.eu-amsterdam-1.abqw2ljrf5trtq6v2u6a5allekc5kfmlnqogxkplyiy7fgungzzp6igote7a HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.131.0 (python 3.12.4; x86_64-Linux) Oracle-PythonCLI/3.45.1\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.131.0\r\nopc-request-id: 0F3CE700D8454530902A7E0DC441462E\r\nContent-Length: 103\r\ndate: Wed, 07 Aug 2024 08:00:43 GMT\r\nhost: iaas.eu-amsterdam-1.oraclecloud.com\r\nx-content-sha256: m0t13amuv3B+Dw4CcEeAfLlxIncodo8ai1fCSXvnU3g=\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host content-length content-type x-content-sha256",keyId="ocid1.tenancy.oc1..aaaaaaaafvbrqwizb2l62d7o46h622ibhfp2at56cfjxak7x3jqgh42ligrq/ocid1.user.oc1..aaaaaaaabxenkv4e3ntvwuk2cdqw23fwno4tmjhhxwfjomgwntznasvxedja/df:35:b7:21:9e:cd:db:04:6b:95:64:96:a2:12:65:8b",signature="Hy9io+gxz98IJaepVo69rqTcUvJM3ZX02LRNSpB4mrl8TL1ovnxL1OwjdTKIdXbpaUJ77l2OOMFcoMGlNMlIQKKS9G7/cYfcojj4ukKDM5Nm/9ydEve/ZaegpSTEqOQUVirC0ctZ4kgUlPtyhwNLOjXt40uLjD8OFkj5T/iG5j4qLc7EsCjWqgWGKqMdJvu87eIoP1vG0kpRXwD5mYzLmrgGxYq26yVIjmlrXvGa8kIY5+JSKYYxS9DZCoRb63rrgvVBbXhHcooHe/RD8xW3NZLy0pFC6r9Pv1+dZt9awe0JYZ4aV64sWSap/i0dpZeOtudylBqmIlZSR+kf4ByETw==",version="1"\r\n\r\n{"volumeGroupReplicas": [{"availabilityDomain": "vuTf:EU-FRANKFURT-1-AD-1", "displayname": "ams2fra"}]}'
reply: 'HTTP/1.1 500 Internal Server Error\r\n'
header: Date: Wed, 07 Aug 2024 08:00:44 GMT
header: opc-request-id: 0F3CE700D8454530902A7E0DC441462E/8B6D786DE251D435C865D6555BEFFA70/C03613C6B1DA1F87FEA53475F65E98FA
header: Content-Type: application/json
header: X-Content-Type-Options: nosniff
header: Strict-Transport-Security: max-age=31536000; includeSubDomains;
header: Content-Length: 69
DEBUG:oci.base_client.139871058036064: 2024-08-07 08:01:09.302390: time elapsed for request 0F3CE700D8454530902A7E0DC441462E: 25.62190629998804
DEBUG:oci.base_client.139871058036064: 2024-08-07 08:01:09.302539: Response status: 500
DEBUG:oci.base_client.139871058036064: 2024-08-07 08:01:09.302675: python SDK time elapsed for deserializing: 5.627982318401337e-06
INFO:oci.base_client.139871058036064: 2024-08-07 08:01:11.195939: Request: PUT https://iaas.eu-amsterdam-1.oraclecloud.com/20160918/volumeGroups/ocid1.volumegroup.oc1.eu-amsterdam-1.abqw2ljrf5trtq6v2u6a5allekc5kfmlnqogxkplyiy7fgungzzp6igote7a
Not using Expect header...
send: b'PUT /20160918/volumeGroups/ocid1.volumegroup.oc1.eu-amsterdam-1.abqw2ljrf5trtq6v2u6a5allekc5kfmlnqogxkplyiy7fgungzzp6igote7a HTTP/1.1\r\nuser-agent: Oracle-PythonSDK/2.131.0 (python 3.12.4; x86_64-Linux) Oracle-PythonCLI/3.45.1\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nconnection: keep-alive\r\ncontent-type: application/json\r\nopc-client-retries: true\r\nopc-client-info: Oracle-PythonSDK/2.131.0\r\nopc-request-id: 586ED009A26647CBBF7FEDC71D7F6854\r\nContent-Length: 103\r\ndate: Wed, 07 Aug 2024 08:01:11 GMT\r\nhost: iaas.eu-amsterdam-1.oraclecloud.com\r\nx-content-sha256: m0t13amuv3B+Dw4CcEeAfLlxIncodo8ai1fCSXvnU3g=\r\nauthorization: Signature algorithm="rsa-sha256",headers="date (request-target) host content-length content-type x-content-sha256",keyId="ocid1.tenancy.oc1..aaaaaaaafvbrqwizb2l62d7o46h622ibhfp2at56cfjxak7x3jqgh42ligrq/ocid1.user.oc1..aaaaaaaabxenkv4e3ntvwuk2cdqw23fwno4tmjhhxwfjomgwntznasvxedja/df:35:b7:21:9e:cd:db:04:6b:95:64:96:a2:12:65:8b",signature="Q8ZyaSobN6+s9b0zwE5ski9BbQUVyg5v1cU07ASHuFhTHO5Cxq8SZZ72snzC348+D93wwuoga5ojh3cxoZkIOzvgF46QDINCtm6TGOooEGIlGUPqmuil6aVqeQfxCJ8BcVP1O6JgRS3GxgssLUge21CdOqIMtc2wpFR/YZBnS49zt5yA4MJR6UZxMNvJvgHxt93aAWp7/iBvp74+m1dtYmS9HSc7oqkflG9d4PpKAeyYPmGRyTcSj3otPHU2ROeoRK06zmXQqRkgzzzzybiepoGOkgM+s/O9VIxYoXKMnZ4gfWAgdYVNRWoepE1vn1q/PMSQewFaJub72tVp8Me8tA==",version="1"\r\n\r\n{"volumeGroupReplicas": [{"availabilityDomain": "vuTf:EU-FRANKFURT-1-AD-1", "displayname": "ams2fra"}]}'
reply: 'HTTP/1.1 500 Internal Server Error\r\n'

for several minutes and then stops with the following error message:

    raise exceptions.TransientServiceError(
oci.exceptions.TransientServiceError: {'target_service': 'blockstorage', 'status': 500, 'code': 'InternalError', 'opc-request-id': '2A034273EB9C4900ABF83605745F79A4/A99916F019AD8B45D648DC2DB4977CDA/96D0D1A4E020E36FEDADC3D2246E5F38', 'message': 'Internal Server Error', 'operation_name': 'update_volume_group', 'timestamp': '2024-08-07T08:05:16.095569+00:00', 'client_version': 'Oracle-PythonSDK/2.131.0', 'request_endpoint': 'PUT https://iaas.eu-amsterdam-1.oraclecloud.com/20160918/volumeGroups/ocid1.volumegroup.oc1.eu-amsterdam-1.abqw2ljrf5trtq6v2u6a5allekc5kfmlnqogxkplyiy7fgungzzp6igote7a', 'logging_tips': 'To get more info on the failing request, refer to https://docs.oracle.com/en-us/iaas/tools/python/latest/logging.html for ways to log the request/response details.', 'troubleshooting_tips': "See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_500__500_internalerror for more information about resolving this error. Also see https://docs.oracle.com/iaas/api/#/en/iaas/20160918/VolumeGroup/UpdateVolumeGroup for details on this operation's requirements. If you are unable to resolve this blockstorage issue, please contact Oracle support and provide them this full error message."}>

Affected version:

$ oci -v
3.45.1

Using the web console I'm able to do it.

kishan0201 commented 3 months ago

Hi @bogdan-m-darie looks like the issue is at the service side, I've tagged the Block Volume team. They'll be able to help with the opc-request-id generated in the error message.

bogdan-m-darie commented 3 months ago

It can be done using Python:

#!/usr/bin/env python3
import oci

config = oci.config.from_file()
config["region"] = "${region}"
core_client = oci.core.BlockstorageClient(config)
update_volume_group_response = core_client.update_volume_group(
    volume_group_id="${volume_group_id}",
    update_volume_group_details=oci.core.models.UpdateVolumeGroupDetails(
        volume_group_replicas=[
            oci.core.models.VolumeGroupReplicaDetails(
                availability_domain="${availability_domain}",
                display_name="${display_name}",
            )
        ],
    ),
)

print(update_volume_group_response.data)