Exemple #1
0
def destroy(db, uuid):
    depl = deployment.open_deployment(db, uuid)
    depl.auto_response = "y"
    depl.destroy_vms()
Exemple #2
0
  resources.ec2KeyPairs.keypair.region = "{0}";

  machine =
    {{ pkgs, ... }}:
    {{
      deployment.ec2.accessKeyId = "logicblox-dev";
      deployment.ec2.region = "{0}";
      deployment.ec2.blockDeviceMapping."/dev/xvdg".size = pkgs.lib.mkOverride 10 {1};
    }};
}}
'''.format(args.region, ebs_size))
f.close()

db = deployment.open_database(deployment.get_default_state_file())
try:
    depl = deployment.open_deployment(db, "ebs-creator")
except Exception:
    depl = deployment.create_deployment(db)
    depl.name = "ebs-creator"
depl.auto_response = "y"
depl.nix_exprs = [os.path.abspath("./ebs-creator.nix"), os.path.abspath("./ebs-creator-config.nix")]
if not args.keep: depl.destroy_resources()
depl.deploy(allow_reboot=True)

m = depl.machines['machine']


# Do the installation.
device="/dev/xvdg"
if args.hvm:
    m.run_command('parted -s /dev/xvdg -- mklabel msdos')