I tried to upgrade the SUSE operating system (OS) on my Amazon Elastic Compute Cloud (Amazon EC2) instance and received errors, such as instance status check failure, de-registered OS, or Zypper commands failure.
Resolution
Look for instance status check failures
For instance status check failures, see How do I troubleshoot an EC2 Linux instance that failed the instance status check due to operating system issues?
Use the susecloud-repocheck script to automatically diagnose and fix minor issues
The susecloud-repocheck script performs an OS repository check. And, it corrects issues that prevent the instance from registering to the SUSE update infrastructure for the following:
- Microsoft Azure
- AWS
- Google Cloud Platform (GCP)
- Pay-as-you-go (PAYG) on-demand instances
For more information, see susecloud-repocheck on the SUSE GitHub repository.
To run the script, use the following command:
$ python3 <(curl -sL https://raw.githubusercontent.com/SUSE/susecloud-repocheck/main/sc-repocheck.py)
The script creates logs in the /var/log/ directory named sc-repocheck_<YYMMDD_hhmmss>.tar.xz.
Manually verify registration and resolve upgrade failures
Verify the instance billingProducts or marketplaceProductCodes code
For PAYG vanilla SLES, verify the instance's billingProducts code. For PAYG SLES for SAP Applications, verify the marketplaceProductCodes code.
Run the following command to verify the billingProducts or marketplaceProductCodes code:
# /usr/bin/curl --noproxy '*' -w "\n" -s -H "X-aws-ec2-metadata-token: $(curl --noproxy '*' -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 300")" http://169.254.169.254/latest/dynamic/instance-identity/document | grep -E 'billingProducts|marketplaceProductCodes'
The following is the output for the command:
billingProducts" : [ "bp-********" ]
Or
"marketplaceProductCodes" : [ "***********************" ],
Check for the SMT registration entries in the /etc/hosts file
In the /etc/hosts file, look for an entry that follows the line # Added by SMT registration do not remove, retain comment as well.
Note: More than one SUSE public cloud update server exists within an AWS Region. For more information, see the list of update server IP addresses for AWS Regions on the SUSE Public Cloud Solutions website.
To verify the current registration status, run the following command:
# SUSEConnect -s
In the preceding command output, verify whether the Status parameter is Registered or Not Registered. If the output is Not Registered, then re-register the instance.
To remove entries from previous registrations, run the following command:
# registercloudguest --clean
To re-register the instance, run the following command:
# registercloudguest --force-new
To verify the current registration status, run the following command:
# SUSEConnect -s
If registration fails, then review the logs in /var/log/cloudregister to determine the failure reason. The following is an example error in the logs:
SUSEConnect error: Errno::ENOSPC: No space left on device
Remove any duplicate or additional SMT registration entries in the /etc/hosts file. The following is a sample entry added by SMT registration:
# vi /etc/hosts
# Added by SMT registration do not remove, retain comment as well
54.246.90.215 smt-ec2.susecloud.net smt-ec2
Troubleshoot common registration errors
To troubleshoot common registration errors, complete the following steps:
-
To verify that the required cloud-regionsrv-client and related dependency packages are installed in your OS, run the following command:
# rpm -qa | grep -E 'cloud-regionsrv-client|cloud-regionsrv-client-plugin-ec2|regionServiceClientConfigEC2|SUSEConnect|suseconnect-ng|python3-ec2metadata|python3-dnspython|python3-lxml|python3-cssselect|python3-M2Crypto|python3-zypp-plugin|libzypp|ruby-common'
The following is sample out from the preceding command:
libzypp-17.31.20-150400.3.40.1.x86_64
suseconnect-ng-1.6.0~git0.31371c8-150400.3.22.1.x86_64
python3-zypp-plugin-0.6.3-150000.4.2.1.noarch
python3-cssselect-1.0.3-150000.3.3.1.noarch
python3-M2Crypto-0.38.0-150400.7.64.x86_64
python3-lxml-4.7.1-150200.3.10.1.x86_64
regionServiceClientConfigEC2-4.1.1-150000.3.27.1.noarch
ruby-common-2.1-3.15.noarch
python3-ec2metadata-5.0.0-150000.3.12.1.noarch
cloud-regionsrv-client-10.1.6-150000.6.105.1.noarch
cloud-regionsrv-client-plugin-ec2-1.0.4-150000.6.105.1.noarch
python3-dnspython-1.15.0-150000.3.2.1.noarch
If the packages are outdated or missing and the operating system doesn't have access to Zypper, then upgrade offline. To upgrade offline, download the rpm packages using Zypper on another working host and transfer the rpm to the non-working host. Then, perform a Zypper install of the rpm packages
-
Identify missing repositories.
-
If your SUSE instance is missing software repositories, then run the following commands to force a new registration with all available repositories.
# registercloudguest --force-new
# SUSEConnect --list-extensions
# zypper lr --uri
Related information
SUSE Linux Enterprise Server (SLES) on Amazon EC2 FAQs