def StartAnalysisVm(args: 'argparse.Namespace') -> None:
  """Start forensic analysis VM.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.
  """
  attach_disks = []
  if args.attach_disks:
    attach_disks = args.attach_disks.split(',')
    # Check if attach_disks parameter exists and if there
    # are any empty entries.
    if not (attach_disks and all(elements for elements in attach_disks)):
      logger.error('error: parameter --attach_disks: {0:s}'.format(
          args.attach_disks))
      return

  ssh_public_key = args.ssh_public_key
  if not ssh_public_key:
    # According to https://docs.microsoft.com/cs-cz/samples/azure-samples/
    # resource-manager-python-template-deployment/resource-manager-python-
    # template-deployment/ there's no API to generate a new SSH key pair in
    # Azure, so we do this manually...
    ssh_public_key = _GenerateSSHKeyPair(args.instance_name)

  logger.info('Starting analysis VM...')
  vm = forensics.StartAnalysisVm(args.default_resource_group_name,
                                 args.instance_name,
                                 int(args.disk_size),
                                 ssh_public_key,
                                 cpu_cores=int(args.cpu_cores),
                                 memory_in_mb=int(args.memory_in_mb),
                                 region=args.region,
                                 attach_disks=attach_disks,
                                 dst_profile=args.dst_profile)

  logger.info('Analysis VM started.')
  logger.info('Name: {0:s}, Started: {1:s}'.format(vm[0].name, str(vm[1])))
Start forensic analysis VM.

Args:
args (argparse.Namespace): Arguments from ArgumentParser.
tools/az_cli.py