Client Deletion

If you need to remove a client from your SUSE Manager Server, you can use the Web UI to delete it. You can also remove a client from the command line. These procedures work for both traditional and Salt clients.

1. Delete a Client with the Web UI

Procedure: Deleting a Client
  1. In the SUSE Manager Web UI, navigate to Systems  System List and select the client to delete.

  2. Click Delete System.

  3. Check the details and click Delete Profile to confirm.

  4. For Salt clients, SUSE Manager attempts to clean up additional configuration. If the client cannot be contacted, you are given the option to cancel the deletion, or delete the client without cleaning up the configuration files.

You can also delete multiple clients using the system set manager. For more information about the system set manager, see System Set Manager.

It is not possible to automatically clean up a traditional client after deleting it. You have to take care of this yourself. Furthermore, cleaning up a Salt client does only disable salt and stop the service if possible. It does not uninstall the package.

Normally you migrate a traditional client to a Salt client without deleting the client. Salt automatically detects that you have a traditional client and does the necessary changes itself. But if you already deleted the traditional client and want to register it as a Salt client again, see Troubleshooting Registering a traditional client as Salt minion after deleting it.

2. Delete a Salt Client on the Command Line (with API Call)

Procedure: Deleting a Client from the Server
  1. Delete the client with the FQDN (Fully Qualified Domain Name):

    spacecmd system_delete FQDN

    spacecmd system_delete also deletes the Salt key.

system_delete offers the following options:

usage: system_delete [options] <SYSTEMS>

    options:
          -c TYPE - Possible values:
             *  'FAIL_ON_CLEANUP_ERR' - fail in case of cleanup error,
             *  'NO_CLEANUP' - do not cleanup, just delete,
             *  'FORCE_DELETE' - try cleanup first but delete server anyway
	        in case of error

3. Delete a Client from the Command Line

3.1. Salt Client

This process is only for SUSE Manager clients, do not run it on the SUSE Manager Server itself.

You must not execute the following procedure on clients running Red Hat Enterprise Linux, Debian, or clones. Instead of zypper use equivalent packager commands such as yum, dnf, or apt.

Procedure: Deleting SLES 12 and 15 Salt Clients
  1. Stop the salt-minion service:

    systemctl stop salt-minion
  2. Remove the repositories and configuration files:

    rm /etc/zypp/repos.d/susemanager\:channels.repo
    rm -r /etc/sysconfig/rhn/
    rm -r /etc/salt/
  3. Remove Client Packages:

    zypper rm salt salt-minion python*-salt sle-manager-tools-release
Procedure: Salt Bundle Client - Manual Registration Cleanup
  1. To unregister, run:

    systemctl stop venv-salt-minion
    zypper rm -y venv-salt-minion
    rm /etc/zypp/repos.d/susemanager\:channels.repo /etc/venv-salt-minion/*
    rm -r /etc/venv-salt-minion/*

For information about the Salt bundle, see Salt Bundle.

This process is only for SUSE Manager clients, do not run it on the SUSE Manager Server itself.

You must not execute the following procedure literally on clients running Red Hat Enterprise Linux, Debian, or clones. Instead of zypper use equivalent packager commands such as yum, dnf, or apt.

Procedure: Traditional SLES 12 and 15 Clients - Manual Cleanup
  1. Stop the osad service (if it is in use):

    systemctl stop osad
  2. On a SLES 12 client remove the following packages if installed. This should be tried first (in case the osad package is not installed, do not list it on the command line):

    zypper rm spacewalksd spacewalk-check zypp-plugin-spacewalk \
    spacewalk-client-tools osad python2-zypp-plugin-spacewalk \
    python2-spacewalk-check python2-spacewalk-client-setup
  3. On a SLES 15 client remove the following packages if installed:

    zypper rm spacewalk-client-setup mgr-daemon spacewalk-check \
    zypp-plugin-spacewalk mgr-osad python3-zypp-plugin-spacewalk \
    python3-spacewalk-check python3-spacewalk-client-setup
  4. You will see the following output:

    Refreshing service 'spacewalk'.
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    The following packages are going to be REMOVED:
      spacewalk-check spacewalk-client-setup spacewalksd zypp
    plugin-python osad
    
    5 packages to remove.
    After the operation, 301.0 KiB will be freed.
    Continue? [y/n/?] (y):

    The above RPM packages are client specific, and should be removed. If this fails, they should be manually removed. The rpm -e command should not be used unless the zypper rm command above failed.

  5. After this is complete, the /etc/sysconfig/rhn/systemid file should be removed. This file only exists on a client machine and is used to register itself with SUSE Manager:

    rm /etc/sysconfig/rhn/systemid
  6. Any configured spacewalk channels should be deleted with:

    rm /etc/zypp/repos.d/spacewalk*
  7. Finally verify that repositories are properly configured. Refresh them on the server and then list them:

    zypper ref -s
    zypper lr

If any repositories pointing to spacewalk still exist, remove them with:

zypper repos -d
zypper removerepo <ID of the repo in the output from previous command>