Skip to content

Commit

Permalink
Merge pull request #343 from cmccoy/no-migration
Browse files Browse the repository at this point in the history
Enable optional migration on GCE. No change to default.
  • Loading branch information
cmccoy committed Jun 29, 2015
2 parents bfcacf3 + ee631fd commit 4e77eb6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion perfkitbenchmarker/gcp/gce_virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
'(see https://cloud.google.com/compute/docs/local-ssd).')
flags.DEFINE_string('gcloud_scopes', None, 'If set, space-separated list of '
'scopes to apply to every created machine')
flags.DEFINE_boolean('gce_migrate_on_maintenance', False, 'If true, allow VM '
'migration on GCE host maintenance.')

FLAGS = flags.FLAGS

Expand Down Expand Up @@ -117,14 +119,16 @@ def _Create(self):
'mode=rw',
'--machine-type', self.machine_type,
'--tags=perfkitbenchmarker',
'--maintenance-policy', 'TERMINATE',
'--no-restart-on-failure',
'--metadata-from-file',
'sshKeys=%s' % tf.name,
'--metadata',
'owner=%s' % FLAGS.owner]
for key, value in self.boot_metadata.iteritems():
create_cmd.append('%s=%s' % (key, value))
if not FLAGS.gce_migrate_on_maintenance:
create_cmd.extend(['--maintenance-policy', 'TERMINATE'])

ssd_interface_option = NVME if NVME in self.image else SCSI
for _ in range(self.max_local_disks):
create_cmd.append('--local-ssd')
Expand Down

0 comments on commit 4e77eb6

Please sign in to comment.