def parse(self): self.parser.usage = '%prog [options]' self.parser.description = ''' Create a new persistent volume (disk) with the given options. ''' self.parser.add_option('-s', '--size', dest='volumeSize', help='Size of the volume in GiBs', metavar='SIZE', default=None, type='int') self.parser.add_option('-t', '--tag', dest='volumeTag', help='Tag of the volume. Only for the user', metavar='NAME', default="") self.parser.add_option('--cow', dest='originUuid', help='Create a copy on write volume based on this uuid', metavar='UUID', default=None) self.parser.add_option('--rebase', dest='rebaseUuid', help='Rebase the CoW volume', metavar='UUID', default=None) self.parser.add_option('--private', dest='volumeVisibility', help='''Set the disk as private (default). Only you can see, use and delete the disk.''', action='store_false') self.parser.add_option('--public', dest='volumeVisibility', help='''Set the disk visibility as public. Any one can see it and use it but can't delete it.''', action='store_true', default=False) StorageCommand.addPDiskEndpointOptions(self.parser) super(MainProgram, self).parse() self.options, _ = self.parser.parse_args()
def parse(self): self.parser.usage = '%prog [options] volume-uuid ...' self.parser.description = ''' Delete a persistent volume (disk) or volumes. The volume-uuid arguments are the unique identifiers of volumes to remove. ''' StorageCommand.addPDiskEndpointOptions(self.parser) super(MainProgram, self).parse() self.options, self.uuids = self.parser.parse_args()
def parse(self): self.parser.usage = '%prog [options] volume-uuid ...' self.parser.description = ''' Detach one or more persistent volumes (disks) that were dynamically attached to a running virtual machine. The volume-uuid arguments are the unique identifiers of volumes to detach. ''' self.parser.add_option('-i', '--instance', dest='instance', help='The ID of the instance to which the volume attaches', metavar='VM_ID', default=0, type='int') StorageCommand.addPDiskEndpointOptions(self.parser) AuthnCommand.addCloudEndpointOptions(self.parser) super(MainProgram, self).parse() self.options, self.uuids = self.parser.parse_args()
def parse(self): self.parser.usage = '%prog [options] volume-uuid' self.parser.description = ''' Attach a persistent volume (disk) to a running virtual machine. The volume-uuid argument is the unique identifier of the volume (disk) to attach. ''' self.parser.add_option('-i', '--instance', dest='instance', help='The ID of the instance to which the volume attaches', metavar='VM_ID', default=0, type='int') StorageCommand.addPDiskEndpointOptions(self.parser) AuthnCommand.addCloudEndpointOptions(self.parser) super(MainProgram, self).parse() self.options, self.uuids = self.parser.parse_args()
def parse(self): self.parser.usage = '%prog [options] [volume-uuid ...]' self.parser.description = ''' Provides information about the volumes (disks) associated with the given identifiers. Provides information about all volumes if no identifiers are given. The volume-uuid arguments are the volume identifiers. ''' self.parser.add_option('-f', '--filter', dest='filters', help='''Filter available disk with specified properties. Name are the one specified when describing disk properties. Values can be python regex pattern. Example: --filter owner:john --filter tag:grid-* will show only john's disk that have a tag matching the regex pattern.''', metavar='name:value', action='append', default=[]) StorageCommand.addPDiskEndpointOptions(self.parser) super(MainProgram, self).parse() self.options, self.uuids = self.parser.parse_args()
def parse(self): options = VmManager.defaultRunOptions() self.parser.add_option('-n', '--number', dest='instanceNumber', help='number of machines to start (default 1)', metavar='INT', default=options['instanceNumber'], type='int') self.parser.add_option('--local-ip', dest='isLocalIp', action='store_true', help='By default, virtual machines are assigned a public IP address. ' 'With this option, a local address is provided, which means that it ' 'not be reachable from the outside, but will be reachable from other ' 'instances in the same data-center.', default=False) self.parser.add_option('--private-ip', dest='isPrivateIp', action='store_true', help='By default, virtual machines are assigned a public IP address. ' 'With this option, a private address is provided, which means that it ' 'not be reachable anywhere. This is useful for instances that initiate ' 'the connection to other machinces.', default=False) self.parser.add_option('--save', dest='saveDisk', action='store_true', help='save image after VM shutdown', default=False) self.parser.add_option('--author-email', dest='authorEmail', help='Used with --save option. Email address of the author of ' 'the new image. After image is saved a notification is sent ' 'with further instructions.', default='', metavar='EMAIL') self.parser.add_option('--author', dest='author', help='Used with --save option. Author of the new image', default='', metavar='NAME') self.parser.add_option('--image-version', dest='newImageGroupVersion', help='Used with --save option. Version for the new image.', default='', metavar='VERSION') self.parser.add_option('--title', dest='title', help='Used with --save option. Title of the new image', default='', metavar='TEXT') self.parser.add_option('--comment', dest='comment', help='Used with --save option. Description of the new image', default='', metavar='TEXT') self.parser.add_option('--marketplace-endpoint-newimage', dest='marketplaceEndpointNewimage', help='Used with --save option. Marketplace to register the new image manifest in. ' 'No default. If not provided, either base image Marketplace or defined ' 'by cloud site will be used.', default='', metavar='URL') self.parser.add_option('-o', '--output', dest='outVmIdsFile', help='save vm-id to a file', metavar='FILE', default=None) self.parser.add_option('--volatile-disk', dest='extraDiskSize', help='volatile data disk size in GB', metavar='INT', action='callback', callback=self.diskSizeOptionCallback, default=0, type='int') self.parser.add_option('--persistent-disk', dest='persistentDiskUUID', help='persistent disk UUID', default=None) self.parser.add_option('--readonly-disk', dest='readonlyDiskId', help='marketplace readonly disk image ID', default=None, metavar='MARKETPLACEID') self.parser.add_option('--qcow-disk-format', dest='useQcowDiskFormat', help='launch instance from an image in qcow2 disk format. Only ' 'used when image is provided as URL. When image is given by ID, disk ' 'format is inferred from the image metadata.', action='store_true', default=False) self.parser.add_option('--address', dest='specificAddressRequest', help='request a specific ip address', metavar='IP', default=None) self.parser.add_option('--no-check-image-url', dest='noCheckImageUrl', help='Turn off image availability check. ' 'Do not check if the location URLs in the image metadata exist.', action='store_true', default=False) self.parser.add_option('--vm-name', dest='vmName', help='name of VM. If not given, a default name will be assigned by cloud layer.', metavar='NAME', default=options['vmName']) self.parser.add_option('--notify', dest='msgRecipients', action='append', help='recipient coordinates (host,vhost,user,pass,queue)', default=[]) StorageCommand.addPDiskEndpointOptions(self.parser) super(MainProgram, self).parse()
def parse(self): options = VmManager.defaultRunOptions() self.parser.add_option('--shared-folder', dest='shared_folder', action='store', help='folder to share over NFS', default=None, type='string') self.parser.add_option('--ssh-hostbased', dest='ssh_hostbased', action='store_true', help='Enable cluster integration through hostbased ssh authentication', default=False) self.parser.add_option('--cluster-admin', dest='cluster_admin', action='store', help='Username for cluster administrator (default root)', default='root', type='string') self.parser.add_option('--cluster-user', dest='cluster_user', action='store', help='Additional username to be created', default=None, type='string') self.parser.add_option('--mpi-machine-file', dest='mpi_machine_file', action='store_true', help='Defines that a machinefile should be prepared for MPI, listing all available ' 'workers and their respective number of cores (slot value). (Default=False)', default=False) self.parser.add_option('--include-master', dest='include_master', action='store_true', help='Defines that the master node should be considered ' 'as part of the worker nodes. (Default=False)', default=False) self.parser.add_option('--add-packages', dest='add_packages', action='store', help='Provide comma separated list of additional packages that you wish to install', default=None, type='string') self.parser.add_option('--master-vmid', dest='master_vmid', action='store', help='VMID of master node if this has been instantiated separately', default=None, type='int') self.parser.add_option('--tolerate-failures', dest='tolerate_failures', action='store_true', help='If set true the program will try to configure the ' 'cluster with as many nodes as it can ' 'in case some of them fail during instantiation', default=False) self.parser.add_option('--clean-after-failure', dest='clean_after_failure', action='store_true', help='In case the program stops on failure it will try to kill all VMs instantiated', default=True) self.parser.add_option('-n', '--number', dest='instanceNumber', help='number of machines to start (default 1) for the cluster', metavar='INT', default=options['instanceNumber'], type='int') self.parser.add_option('--save', dest='saveDisk', action='store_true', help='save image after VM shutdown', default=False) self.parser.add_option('-o', '--output', dest='outVmIdsFile', help='save vm-id to a file', metavar='FILE', default=None) self.parser.add_option('--volatile-disk', dest='extraDiskSize', help='volatile data disk size in GB', metavar='INT', action='callback', callback=self.diskSizeOptionCallback, default=0, type='int') self.parser.add_option('--persistent-disk', dest='persistentDiskUUID', help='persistent disk UUID', default=None) self.parser.add_option('--readonly-disk', dest='readonlyDiskId', help='marketplace readonly disk image ID', default=None, metavar='MARKETPLACEID') self.parser.add_option('--qcow-disk-format', dest='useQcowDiskFormat', help='launch instance from an image in qcow2 disk format. This option requires ', action='store_true', default=False) self.parser.add_option('--address', dest='specificAddressRequest', help='request a specific ip address', metavar='IP', default=None) self.parser.add_option('--no-check-image-url', dest='noCheckImageUrl', help='Do not check image availability.', action='store_true', default=False) self.parser.add_option('--vm-name', dest='vmName', help='name of VM. If not given, a default name will be assigned by cloud layer.', metavar='NAME', default=options['vmName']) StorageCommand.addPDiskEndpointOptions(self.parser) super(MainProgram, self).parse()