psm MySQLCS clone-service

Create a clone MySQL Cloud Service instance from a snapshot of an existing instance.

Syntax

In the following syntax, line breaks have been added for clarity. Do not include them when entering the command.

psm MySQLCS clone-service -c|--config-payload path-to-json-file 
    [-wc|--wait-until-complete true|false]
    [-of|--output-format json|html|short]

Parameters

Parameter Description

-c|--config-payload path-to-json-file

Specifies the path to a JSON file containing the information necessary to create an MySQL Cloud Service clone from an existing instance. The format of this file is the same as the request body you provide when creating an instance using the REST API. .

The parameters of the payload are similar to those of the psm MySQLCS create-service , but the following parameters cannot be changed for the clone:

  • serviceLevel

  • serviceVersion

  • edition

  • dbstorage

  • mysqlCharset

  • ibkupFile

  • ibkupCloudStorageUser

  • ibkupCloudStoragePassword

Note:

If MySQL Enterprise Manager is enabled in the source, it is enabled in the snapshot also, and cannot be disabled in any clones made from that snapshot. If it is not enabled, it is not possible to enable it in the clone.

–wc|--wait-until-complete true|false

(Optional) If set to true, the command behaves synchronously. That is, it does not return until the submitted job is complete. The following message is displayed until the job is complete:

Waiting for the job to complete... (it cannot be cancelled)

The default value is false.

-of|--output-format json|html|short

(Optional) Specifies the output format of the command’s response:

  • json—output is formatted as a JSON array.

  • html—output is formatted as HTML

  • short—output is formatted as a brief summary.

The default output format is the one you specified when using the psm setup command to configure the psm CLI.

JSON Payload

The JSON payload has the following syntax:

{
    "backupDestination":"backup-types",
    "cloudStorageContainer":"name-of-container",
    "cloudStorageUser":"storage-username",
    "cloudStoragePassword":"storage-user-password",
    "cloudStorageContainerAutoGenerate":"",
    "useHighPerformanceStorage":"true-or-false",
    "vmPublicKeyText":"contents-of-public-ssh-key",
    "serviceName":"nameoftheservice",
    "serviceDescription":"description of the service",
    "tags":[
			{
				"key":"required",
				"value":""
			}
	  ],
    "ipNetwork":"name-of-IP-network",
    "subnet":"name-of-subnet",
    "region":"name-of-region",
    "availabilityDomain":"name-of-OCI-data-center",
    "serviceLevel":"PAAS",
    "vmUser":"opc",
    "enableNotification":"",
    "notificationEmail":"",
    "sourceServiceName":"required",
    "snapshotName":"",
    "noRetry":"",
    "components": {
      "mysql": {
       "shape": "oracle-compute-shape",
       "mysqlUserName": "mysql-server-username",
       "mysqlUserPassword": "mysql-server-user-password",
       "dbName": "name-of-database",
       "mysqlEMPort":"tomcat-listening-port",
       "enterpriseMonitor":"yes-or-no",
       "enterpriseMonitorManagerUser":"admin-username",
       "enterpriseMonitorManagerPassword":"admin-user-password",
       "enterpriseMonitorAgentUser":"agent-username",
       "enterpriseMonitorAgentPassword":"agent-user-password",
       "ipReservations":[]
    }
  }
}
Parameter Description

serviceName

Name of the MySQL Cloud Service instance.

The service name:

  • Must not exceed 50 characters.

  • Must start with a letter.

  • Must contain only letters, numbers, or hyphens.

  • Must not contain any other special characters.

  • Must be unique within the identity domain.

serviceDescription

Free-form text that provides additional information about the service instance.

tags

Array. Enables tagging of the instance with keys or key:value pairs. For example:

"tags":[
			{
				"key":"Owner",
				"value":"John"
			},
			{
				"key":"Department",
				"value":"Quality"
			},
			{
				"key":"Server1",
			},
	  ],

vmPublicKeyText

File that contains the public key for the secure shell (SSH). This key will be used for authentication when connecting to the MySQL Cloud Service instance using an SSH client.

For example:
"VMsPublicKey" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOOVKYC3NI6FQd63NTlEGhvGuk7+
H69VCYXLC6JGIhaNQGb0DnEukcDVlONInrY0OFKD1NYFGPwuh+C65mgv3af+fCerUedWZwFKzuo+vNikQ9DO
I7OIpCN3YHgZW43OmK51G2hfmi7QFjyNpJdUkw2GQb+IlP3lVAF4cQ5Pf1LZfn8oJVfDpAlZuIqR5MBDcoi/
dNEO2a6o+Wm5tCOrkTuOLjOFqdWG0ugAsZyz/KwIZL9/ks4AGeM+RrJr8KA6Ck4XlSG62sMD4ph5GZSXQYsvod
JjypC8XnAb6nW5LHEq6KYSooG/UBgzUVW0bsxFQoHO1nGtzZmn0KJd5Gu3rt xperiment"

You generate the SSH key using SSH key-generation tools or by using the SSH key-generation in the Provision New Oracle MySQL Cloud Service wizard.

vmUser

This must be set to opc, the default administration user for the instance.

enableNotification

Set to true to enable service-level notifications. If this is set, you must specify an email address in the notificationEmail field. Notifications related to the success or failure of service creation are sent to the email address.

notificationEmail

Email address to which service—level notifications are sent. enableNotification must be set to true .

ipNetwork

Specify the name of IP Network for your service. IP Networks can be created using Compute Console or REST API. To place your service in shared network, do not include this parameter in your payload.

region

Applicable only to accounts which support regions. Name of the region where the MySQL Cloud Service instance is to be provisioned.

(Not applicable in Oracle Cloud Infrastructure) A region name must be specified if you intend to use ipReservations or ipNetwork.

subnet

This parameter is relevant to Oracle Cloud Infrastructure, only. Specify the Oracle Cloud Identifier (OCID) of a subnet from a virtual cloud network (VCN) that you had created previously in Oracle Cloud Infrastructure.

For more information, see Prerequisites for Oracle Platform Services on Oracle Cloud Infrastructure in the Oracle Cloud Infrastructure documentation.

availabilityDomain

This attribute is available only on Oracle Cloud Infrastructure. It is required along with region and subnet.

Name of a data center location in the Oracle Cloud Infrastructure region that is specified in region. A region is a localized geographic area, composed of one or more availability domains (data centers).

The availability domain value format is an account-specific prefix followed by <region>-<ad>. For example, FQCn:US-ASHBURN-AD1 where FQCn is the account-specific prefix.

See Regions and Availability Domains in the Oracle Cloud Infrastructure Services documentation.

noRetry

If the first attempt to create an instance fails, the system automatically tries again. If the first attempt fails, and this parameter is set to true, no further attempts are made to create the instance. Default value is false.

backupDestination

A string containing the backup configuration for the service instance:

  • BOTH—Configure backups to local storage on the service instance and to an Oracle Storage Cloud container; corresponding to the, Both Cloud Storage and Local Storage backup destination in the Provision New Oracle MySQL Cloud Service wizard.

  • NONE—Configure no backups; that is, the None backup destination.

cloudStorageContainer

A string containing the Oracle Storage Cloud container for backups. This string has the form:

instance-id_domain/container

where instance is the name of the Oracle Storage Cloud Service instance, id_domain is the name of the identity domain, and container is the name of the container.

Include this parameter only if the backupDestination is "BOTH".

cloudStorageUser

The user name of an Oracle Cloud user with read/write access to the specified cloudStorageContainer.

Include this parameter only if the backupDestination is "BOTH".

cloudStoragePassword

A string containing the password of the specified cloudStorageUser.

Include this parameter only if the backupDestination is "BOTH".

cloudStorageContainerAutoGenerate

Whether to create the storage container, or not. This creates the storage container, if an existing container, using the details defined, does not exist. Boolean value, yes or no.

useHighPerformanceStorage

Set this to true to use high performance storage. With this option the storage attached to nodes use SSDs (solid state drives) instead of HDDs (hard disk drives). Use this option for performance-critical workloads. An additional cost is associated with this type of storage.

sourceServiceName

The name of the service the snapshot is based on.

snapshotName

The name of the snapshot to base the new service on. If no snapshot name is provided, the latest snapshot of the named source service is used.

shape

A string containing the Oracle Compute Cloud shape for the service instance:

  • oc3 — 1 OCPU with 7.5 GB RAM

  • oc4 — 2 OCPUs with 15 GB RAM

  • oc5 — 4 OCPUs with 30 GB RAM

  • oc6 — 8 OCPUs with 60 GB RAM

  • oc7 — 16 OCPUs with 120 GB RAM

  • oc1m — 1 OCPU with 15 GB RAM

  • oc2m — 2 OCPUs with 30 GB RAM

  • oc3m — 4 OCPUs with 60 GB RAM

  • oc4m — 8 OCPUs with 120 GB RAM

  • oc5m — 16 OCPUs with 240 GB RAM

mysqlUserName

The MySQL Server user name. The default value is root.

mysqlUserPassword

The MySQL Server user’s password.

mysqlPort

The port the MySQL server listens on. The default is 3306.

mysqlEMPort

The port the MySQL Enterprise Monitor’s application server, Apache Tomcat, listens on. By default, this is 18443. By default, an access rule is created for MySQL Enterprise Monitor, called ora_p2admin_em. You must enable this access rule to access MySQL Enterprise Monitor.

Note:

If you define a port other than 18443, you must create a new access rule, and configure it to use the required port. The new access rule must use the same configuration as ora_p2admin_em, but with the new port instead of 18443.

enterpriseMonitor

Note:

If MySQL Enterprise Manager is enabled in the source, it is enabled in the snapshot also, and cannot be disabled in any clones made from that snapshot. If it is not enabled, it is not possible to enable it in the clone.

enterpriseMonitorManagerUser

The name of the MySQL Enterprise Monitor’s Manager user. This is the user who configures the installation, adds users, manages the MySQL Enterprise Service Manager, and so on.

enterpriseMonitorManagerPassword

The password for the Manager User.

The password you enter:

  • Must be 8 to 30 characters in length.

  • Must contain at least one lowercase letter

  • Must contain at least one uppercase letter

  • Must contain at least one number

  • Must contain at least one of these symbols: _ (underscore), # (hash sign), or $ (dollar sign).

enterpriseMonitorAgentUser

The name of the Agent user.

Note:

No agent installations are provided at this time. It is currently only possible to install the MySQL Enterprise Service Manager, which can monitor any MySQL instances, local or remote, using a built-in agent.. If you want to monitor MySQL instances installed on other MySQL Cloud Service instances, you can configure the MySQL Service Manager to monitor them, but cannot monitor a remote host’s operating system, file system, or network interfaces. Although agent installations are not currently provided, it is mandatory to define an Agent User and Password to properly configure the MySQL Enterprise Monitor. These parameters can be changed later.

enterpriseMonitorAgentPassword

The password for the Agent User.

The password you enter:

  • Must be 8 to 30 characters in length.

  • Must contain at least one lowercase letter

  • Must contain at least one uppercase letter

  • Must contain at least one number

  • Must contain at least one of these symbols: _ (underscore), # (hash sign), or $ (dollar sign).

ipReservations

Specify the IP Addresses reserved for the service.

Examples

The following example creates a clone based on a snapshaot as specified by information provided in the create_MySQL57.json file.

$ psm MySQLCS clone-service --config-payload clone_MySQL57.json
"Accepted"
Job ID : 553993

Note:

You can track the progress of this command using the operation-status command.

The following shows an example of the payload file:

{
	"serviceName":"MySQL57Service",
	"serviceDescription":"mysql cloud service payload",
	"tags":[
			{
				"key":"Owner",
				"value":"John"
			},
			{
				"key":"Department",
				"value":"Quality"
			},
			{
				"key":"Server1",
			},
	  ],
	"vmPublicKeyText":"ssh-rsa AAAAB3Nz...",     # key truncated for readability
	"enableNotification":"yes",
	"notificationEmail":"service.owner@oracle.com",
	"backupDestination":"BOTH",
	"cloudStorageContainer":"Storage-Storage/MySQLProvisioning",
	"cloudStorageUser":"StorageUser",
	"cloudStoragePassword":"PasswordStorage",
	"sourceServiceName":"MySQL57–aas",
	"snapshotName":"MySQL57–aas-snapshot1",
	"components":{
     "mysql":{
       "shape":"oc1m"
       "mysqlUserName":"root",
       "mysqlUserPassword":"adminPassword$"
      }
   }
}