'Clone a new LXC container from an existing container.
This method will clone an existing container to a new container using
the `clone_name` variable as the new container name. The method will
create a container if the container `name` does not exist.
Note that cloning a container will ensure that the original container
is "stopped" before the clone can be done. Because this operation can
require a state change the method will return the original container
to its prior state upon completion of the clone.
Once the clone is complete the new container will be left in a stopped
state.'

def _container_create_clone(self):

    container_state = self._get_state()
    if (container_state != 'stopped'):
        self.state_change = True
        self.container.stop()
    build_command = [self.module.get_bin_path('lxc-clone', True)]
    build_command = self._add_variables(variables_dict=self._get_vars(variables=LXC_COMMAND_MAP['clone']['variables']), build_command=build_command)
    if (self.module.params.get('clone_snapshot') in BOOLEANS_TRUE):
        build_command.append('--snapshot')
    elif (self.module.params.get('backing_store') == 'overlayfs'):
        build_command.append('--snapshot')
    (rc, return_data, err) = self._run_command(build_command)
    if (rc != 0):
        message = 'Failed    executing    lxc-clone.'
        self.failure(err=err, rc=rc, msg=message, command='    '.join(build_command))
    else:
        self.state_change = True
        if (container_state == 'running'):
            self.container.start()
        elif (container_state == 'frozen'):
            self.container.start()
            self.container.freeze()
    return True
