Esempio n. 1
0
    def _Create(self):
        """Creates the Azure RDS instance.

    Raises:
      NotImplementedError: if unknown how to create self.spec.engine.
      Exception: if attempting to create a non high availability database.

    """
        if self.spec.engine == relational_db.MYSQL:
            self._InstallMySQLClient()
        if self.is_managed_db:
            self._CreateAzureSqlInstance()
        else:
            self.endpoint = self.server_vm.ip_address
            if self.spec.engine == relational_db.MYSQL:
                self._InstallMySQLServer()
            else:
                raise Exception(
                    'Engine {0} not supported for unmanaged databases.'.format(
                        self.spec.engine))
            self.firewall = azure_network.AzureFirewall()
            self.firewall.AllowPort(
                self.server_vm,
                '3306',
                source_range=['%s/32' % self.client_vm.ip_address])
            self.unmanaged_db_exists = True
            self._ApplyMySqlFlags()
Esempio n. 2
0
 def _CreateAzureUnmanagedSqlInstance(self):
     """Creates an Azure Sql Instance hosted inside of a VM."""
     self.endpoint = self.server_vm.ip_address
     self._SetupUnmanagedDatabase()
     self.firewall = azure_network.AzureFirewall()
     self.firewall.AllowPort(
         self.server_vm,
         self.port,
         source_range=['%s/32' % self.client_vm.ip_address])
Esempio n. 3
0
    def _CreateAzureUnmanagedSqlInstance(self):
        """Creates an Azure Sql Instance hosted inside of a VM."""
        self.endpoint = self.server_vm.ip_address
        if self.spec.engine == relational_db.MYSQL:
            self._InstallMySQLServer()
            self._ApplyMySqlFlags()
        else:
            raise Exception(
                'Engine {0} not supported for unmanaged databases.'.format(
                    self.spec.engine))

        self.firewall = azure_network.AzureFirewall()
        self.firewall.AllowPort(
            self.server_vm,
            '3306',
            source_range=['%s/32' % self.client_vm.ip_address])