Skip to content

OCI : How to change VCN Name?

Starting my first experience with Oracle Cloud Infrastructure, I played with my lab and wanted to change my VCN name. I thought it might be more than easily with the Web Console, but could realise this was not possible. I find out that the only way to do it was through the command line. So great opportunity to start learning first OCI commands.

List compartment to get needed IDs

Of course the first challenge was to get the compartment appropriate ID. And as I followed oracle training recommendations to separate resource family into compartment, I had more than one existing.

To do so I ran following command from the Cloud Shell console:

myocicloud@cloudshell:~ (eu-zurich-1)$ oci iam compartment list --compartment-id-in-subtree 1

List VCN

Having the appropriate compartment Id I could list the existing VCN:

Questions about your own setup? A dbi services consultant can look at your case.

Talk to an expert (opens in a new tab)
myocicloud@cloudshell:~ (eu-zurich-1)$ oci network vcn list -c "ocid1.compartment.oc1..aaaaaaaasbt3rfrxmgjb2qoe2g3rmjihiulkm4owxqlp7t2fpcs7eiaxwxkq"
{
  "data": [
    {
      "byoipv6-cidr-blocks": null,
      "cidr-block": "10.0.0.0/16",
      "cidr-blocks": [
        "10.0.0.0/16"
      ],
      "compartment-id": "ocid1.compartment.oc1..aaaaaaaasbt3rfrxmgjb2qoe2g3rmjihiulkm4owxqlp7t2fpcs7eiaxwxkq",
      "default-dhcp-options-id": "ocid1.dhcpoptions.oc1.eu-zurich-1.aaaaaaaabytg3uxkb3am347vccifaxbj3ds6chasyxb2vzw5aj5275vtlvoq",
      "default-route-table-id": "ocid1.routetable.oc1.eu-zurich-1.aaaaaaaaj7a77k4iufdstacgcbuf3ih3ykjbfevdaz4ns6e5jjgdivgqaxeq",
      "default-security-list-id": "ocid1.securitylist.oc1.eu-zurich-1.aaaaaaaav4sroetsvyclgp5vdiynbq4wxsvp52akhflkcyoe4ab6cz4rozjq",
      "defined-tags": {
        "Oracle-Tags": {
          "CreatedBy": "[email protected]",
          "CreatedOn": "2023-01-24T12:59:27.772Z"
        }
      },
      "display-name": "VNC_xChange",
      "dns-label": "vncxchange",
      "freeform-tags": {
        "VCN": "VCN-2023-01-24T12:58:34"
      },
      "id": "ocid1.vcn.oc1.eu-zurich-1.amaaaaaavo3cm5ya7mpwerd6dbqexwpandduwk2cciifpmeorinuix4cdyxq",
      "ipv6-cidr-blocks": null,
      "ipv6-private-cidr-blocks": null,
      "lifecycle-state": "AVAILABLE",
      "time-created": "2023-01-24T12:59:27.883000+00:00",
      "vcn-domain-name": "vncxchange.oraclevcn.com"
    }
  ]
}

Rename VCN

To finally rename it:

myocicloud@cloudshell:~ (eu-zurich-1)$ oci network vcn update --vcn-id "ocid1.vcn.oc1.eu-zurich-1.amaaaaaavo3cm5ya7mpwerd6dbqexwpandduwk2cciifpmeorinuix4cdyxq" --display-name VCN_xChange
{
  "data": {
    "byoipv6-cidr-blocks": null,
    "cidr-block": "10.0.0.0/16",
    "cidr-blocks": [
      "10.0.0.0/16"
    ],
    "compartment-id": "ocid1.compartment.oc1..aaaaaaaasbt3rfrxmgjb2qoe2g3rmjihiulkm4owxqlp7t2fpcs7eiaxwxkq",
    "default-dhcp-options-id": "ocid1.dhcpoptions.oc1.eu-zurich-1.aaaaaaaabytg3uxkb3am347vccifaxbj3ds6chasyxb2vzw5aj5275vtlvoq",
    "default-route-table-id": "ocid1.routetable.oc1.eu-zurich-1.aaaaaaaaj7a77k4iufdstacgcbuf3ih3ykjbfevdaz4ns6e5jjgdivgqaxeq",
    "default-security-list-id": "ocid1.securitylist.oc1.eu-zurich-1.aaaaaaaav4sroetsvyclgp5vdiynbq4wxsvp52akhflkcyoe4ab6cz4rozjq",
    "defined-tags": {
      "Oracle-Tags": {
        "CreatedBy": "[email protected]",
        "CreatedOn": "2023-01-24T12:59:27.772Z"
      }
    },
    "display-name": "VCN_xChange",
    "dns-label": "vncxchange",
    "freeform-tags": {
      "VCN": "VCN-2023-01-24T12:58:34"
    },
    "id": "ocid1.vcn.oc1.eu-zurich-1.amaaaaaavo3cm5ya7mpwerd6dbqexwpandduwk2cciifpmeorinuix4cdyxq",
    "ipv6-cidr-blocks": null,
    "ipv6-private-cidr-blocks": null,
    "lifecycle-state": "AVAILABLE",
    "time-created": "2023-01-24T12:59:27.883000+00:00",
    "vcn-domain-name": "vncxchange.oraclevcn.com"
  },
  "etag": "1dc33ee3"
}

Checking the result:

myocicloud@cloudshell:~ (eu-zurich-1)$ oci network vcn list -c "ocid1.compartment.oc1..aaaaaaaasbt3rfrxmgjb2qoe2g3rmjihiulkm4owxqlp7t2fpcs7eiaxwxkq" | grep display-name
      "display-name": "VCN_xChange",

Conclusion

This is really my first experience with OCI and I might update this blog with a better way to do so in the future for sure. But just wanted to share my findings here.

I could find the same guidance in oracle Doc ID 2918071.1.

Moreover this is only a solution to change the display name of a VCN, knowing that all component created initially with the VCN and attached to it as Domain Name, Route Table, Security List, DNS Resolver will still reflect the old name used during the creation.

Let’s work together

Ready to operate at
the next level?

Tell us about your challenge. We’ll bring the depth, the expertise, and the Swiss precision.

Marc Wagner

Marc Wagner

With more than 20 years of IT experience, including 16 years in customer services for high-availability Telecom Operator environments, Marc Wagner now specializes in Oracle Database technologies (ODA, backup and recovery, high availability), with additional experience in Windows, Solaris, Linux, Perl, SQL/PLSQL, and Shell scripting. He leads the Oracle Data Guard, ODA, and DMK workshops and the development of the dmk_dbbackup, dmk_dbduplicate, and dmk_ha plugins. Prior to dbi services, he spent 16 years at Oracle, rising to M2 Support Manager overseeing a team of 15 engineers worldwide. He holds a Master-Engineer degree in Computer Science from CNAM Mulhouse. His industry experience covers telecom.View Author posts

109 posts since January 2018

Most read in Oracle

The Oracle posts our readers open most: the all-time favourites, and what is trending right now.

Leave a Comment

Your email address will not be published. Required fields are marked *