~rogpeppe/juju-core/azure

« back to all changes in this revision

Viewing changes to environs/azure/environ.go

  • Committer: Tarmac
  • Author(s): Raphael Badin
  • Date: 2013-07-16 10:25:00 UTC
  • mfrom: (1461.1.3 empty-methods)
  • Revision ID: tarmac-20130716102500-ppf28lfz2u90d5q8
[r=rvb] Azure provider: implement more methods

This branch does two things:
- it replaces the panic() calls in the port-related methods with empty methods. The goal here is to be able to test the provider more easily, provided that you open/close the ports manually.
- it updates the name of the image used because an image with support for Azure in cloud-init has just been made available.

In case you wonder, the change s/ExtraSmall/Small is there to accomodate installing mysql on a node. ExtraSmall does not have enough memory.

This is all for the sake of testing, all of the code that this branch changes will be re-worked later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
        // Initially, this is the only location where Azure supports Linux.
33
33
        // TODO: This is to become a configuration item.
34
 
        serviceLocation = "East US"
 
34
        // We currently use "North Europe" because the temporary Saucy image is
 
35
        // only supported there.
 
36
        serviceLocation = "North Europe"
35
37
 
36
38
        // The deployment slot where to deploy instances ('Production' or
37
39
        // 'Staging').
346
348
 
347
349
        // TODO: use simplestreams to get the name of the image given
348
350
        // the constraints provided by Juju.
349
 
        // In the meantime we use a Precise image.  Note that this image's
350
 
        // cloud-init does not support Azure yet.
351
 
        sourceImageName := "b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-12_04_2-LTS-amd64-server-20130527-en-us-30GB"
 
351
        // In the meantime we use a temporary Saucy image containing a
 
352
        // cloud-init package which supports Azure.
 
353
        sourceImageName := "b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-DEVELOPMENT-20130713-Juju_ALPHA-en-us-30GB"
352
354
        // TODO: virtualNetworkName is the virtual network to which the
353
355
        // deployment will belong. We'll want to build this out later to
354
356
        // support private communication between instances.
436
438
func (env *azureEnviron) newRole(vhd *gwacl.OSVirtualHardDisk, userData string, roleHostname string) *gwacl.Role {
437
439
        // TODO: Derive the role size from the constraints.
438
440
        // ExtraSmall|Small|Medium|Large|ExtraLarge
439
 
        roleSize := "ExtraSmall"
 
441
        roleSize := "Small"
440
442
        // Create a Linux Configuration with the username and the password
441
443
        // empty and disable SSH with password authentication.
442
444
        hostname := roleHostname
640
642
 
641
643
// OpenPorts is specified in the Environ interface.
642
644
func (env *azureEnviron) OpenPorts(ports []instance.Port) error {
643
 
        panic("unimplemented")
 
645
        // TODO: implement this.
 
646
        return nil
644
647
}
645
648
 
646
649
// ClosePorts is specified in the Environ interface.
647
650
func (env *azureEnviron) ClosePorts(ports []instance.Port) error {
648
 
        panic("unimplemented")
 
651
        // TODO: implement this.
 
652
        return nil
649
653
}
650
654
 
651
655
// Ports is specified in the Environ interface.
652
656
func (env *azureEnviron) Ports() ([]instance.Port, error) {
653
 
        panic("unimplemented")
 
657
        // TODO: implement this.
 
658
        return []instance.Port{}, nil
654
659
}
655
660
 
656
661
// Provider is specified in the Environ interface.