def capture_vm_image(self, service_name, deployment_name, role_name, options):
_validate_not_none('<STR_LIT>', service_name)<EOL>_validate_not_none('<STR_LIT>', deployment_name)<EOL>_validate_not_none('<STR_LIT>', role_name)<EOL>_validate_not_none('<STR_LIT>', options)<EOL>_validate_not_none('<STR_LIT>', options.os_state)<EOL>_validate_not_none('<STR_LIT>', options.vm_image_name)<EOL>_validate_not_none('<STR_LIT>', options.vm_image_label)<EOL>return self._perform_post(<EOL>self._get_capture_vm_image_path(service_name, deployment_name, role_name),<EOL>_XmlSerializer.capture_vm_image_to_xml(options),<EOL>as_async=True)<EOL>
Creates a copy of the operating system virtual hard disk (VHD) and all
of the data VHDs that are associated with the Virtual Machine, saves
the VHD copies in the same storage location as the original VHDs, and
registers the copies as a VM Image in the image repository that is
associated with the specified subscription.

service_name:
    The name of the service.
deployment_name:
    The name of the deployment.
role_name:
    The name of the role.
options:
    An instance of CaptureRoleAsVMImage class.
options.os_state:
    Required. Specifies the state of the operating system in the image.
    Possible values are: Generalized, Specialized 
    A Virtual Machine that is fully configured and running contains a
    Specialized operating system. A Virtual Machine on which the
    Sysprep command has been run with the generalize option contains a
    Generalized operating system. If you capture an image from a
    generalized Virtual Machine, the machine is deleted after the image
    is captured. It is recommended that all Virtual Machines are shut
    down before capturing an image.
options.vm_image_name:
    Required. Specifies the name of the VM Image.
options.vm_image_label:
    Required. Specifies the label of the VM Image.
options.description:
    Optional. Specifies the description of the VM Image.
options.language:
    Optional. Specifies the language of the VM Image.
options.image_family:
    Optional. Specifies a value that can be used to group VM Images.
options.recommended_vm_size:
    Optional. Specifies the size to use for the Virtual Machine that
    is created from the VM Image.