Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Configuring OS Dump

Updated on 2024-10-18 GMT+08:00

Scenarios

If your ECS OS becomes faulty, a system crash or blue screen of death (BSOD) may occur. In this case, you can configure OS dump to enable the memory data to be stored in a file. You can then use this information to locate the fault.

This section describes how to configure an OS dump.

Background

An OS dump is also known as a kernel dump or crash dump. When a system crash (usually a stop error) occurs, the memory data is completely backed up in real time. A complete memory dump is produced from this event.

The OS dump function relies on the OS kernel's capability of processing hardware exceptions. The OS kernel can detect hardware exceptions and determine the handling method based on the exception type. If the system encounters an exception or error that cannot be handled, some or all information will be dumped to disks. The information includes the CPU register, physical memory, process status, file system status, and hardware device status.

An OS dump can be triggered in the following ways:

  • System crash: When an exception or error that cannot be handled occurs, such as invalid memory access or kernel panic, the system automatically triggers a dump.
  • Manual triggering: The system administrator can use commands or operations to manually trigger a dump. For example, in Linux, the system administrator can add the parameter c to /proc/sysrq-trigger to trigger a dump.
  • Scheduled triggering: The system administrator can schedule a dump at a specified time to simulate a system crash and obtain the system information at that time.

To obtain a dump file, you need to configure the OS of your ECS. For example, in the Linux OS, you need to configure kdump. The following describes how to manually trigger a dump.

Constraints

  • An OS dump will cause the ECS to restart. Back up data in advance to prevent data loss.
  • Kunpeng ECSs do not support OS dump.
  • OS dump is only available for ECSs in Running, Stopped, or Faulty status.
  • OS dump is only available for ECSs whose specifications are 4 vCPUs and 8 GiB of memory, or above.
  • The reserved memory must be greater than the memory of the ECS.

Configuring an OS Dump (Windows)

The Windows Server 2016 is used as an example. For operations on more versions, see the help documents provided on the corresponding official website.

  1. Log in to a Windows ECS.
  2. Open Control Panel and choose System > Advanced system settings.
    Figure 1 Advanced system settings
  3. In the Performance area of the System Properties dialog box, click Settings.
  4. In the Virtual memory area on the Advanced tab, click Change.
    Figure 2 Performance options
  5. In the Virtual Memory dialog box, select Automatically manage paging file size for all drives.
    Figure 3 Virtual memory
  6. Click OK to complete the virtual memory settings.
  7. In the Startup and Recovery area of the System Properties dialog box, click Settings.
  8. Configure required parameters.
    • Write debugging information: Select Complete memory dump.
    • Dump file: Change %SystemRoot%\MEMORY.DMP to a local drive with sufficient disk space, for example, E:\Memory.dmp.
    Figure 4 Startup and recovery settings
  9. Click OK.
  10. Restart the ECS to complete the settings.

Configuring an OS Dump (Linux)

The CentOS 7.5 is used as an example. For operations on more versions, see the help documents provided on the corresponding official website.

  1. Log in to a Linux ECS.
  2. Install kexec-tools.

    yum install kexec-tools

  3. Check the size of the memory reserved for crashkernel.

    cat /etc/default/grub

    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="net.ifnames=0 consoleblank=600 console=tty0 console=ttyS0,115200n8 spectre_v2=off nopti crashkernel=auto  "
    GRUB_DISABLE_RECOVERY="true"
  4. Adjust the reserved memory size by changing the value of crashkernel.

    vim /etc/default/grub

    The reserved memory size for crashkernel is auto. You can adjust the reserved memory size by changing the value of crashkernel in the GRUB_CMDLINE_LINUX field.

    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="net.ifnames=0 consoleblank=600 console=tty0 console=ttyS0,115200n8 spectre_v2=off nopti crashkernel=256M"
    GRUB_DISABLE_RECOVERY="true"
    NOTE:

    You can determine the reserved memory size for crashkernel based on the system architecture. If the size is too small, the coredump file may fail to be generated.

    In this example, the system memory is 1 GiB, and the reserved memory is 256 MB.

  5. Generate a new grub configuration file.

    grub2-mkconfig -o /boot/grub2/grub.cfg

  6. Edit the kernel parameter file /etc/sysctl.conf.

    vim /etc/sysctl.conf

    Add the following parameters to the /etc/sysctl.conf file to switch the OS to the emergency mode and generate a memory dump when an NMI is received:

    kernel.panic_on_unrecovered_nmi=1
    kernel.unknown_nmi_panic=1
  7. Reboot the system.

    reboot

  8. Open /etc/kdump.conf and modify the default configuration.

    vim /etc/kdump.conf

    # Specify the path where the coredump file is stored.
    path /var/crash
    # Add the parameter -c to compress the coredump file.
    core_collector makedumpfile -c -l --message-level 1 -d 31
    # Reboot the system after the coredump file is generated.
    default reboot
  9. Start kdump and enable auto-start upon system boot.

    systemctl start kdump.service

    systemctl enable kdump.service

  10. Check whether kdump is started.

    service kdump status

    Redirecting to /bin/systemctl status kdump.service
    ● kdump.service - Crash recovery kernel arming
       Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: enabled)
       Active: active (exited) since Wed 2024-05-22 21:19:47 CST; 11min ago
     Main PID: 591 (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/kdump.service

    systemctl is-active kdump.service

    active

Triggering an OS Dump

  1. Log in to the management console.
  2. Click in the upper left corner and select your region and project.
  3. Click . Under Compute, click Elastic Cloud Server.
  4. In the ECS list, locate the row containing the target ECS and choose More > Troubleshoot > Trigger OS Dump in the Operation column.
  5. Learn about the OS dump risks and select the check box.
  6. Click OK to trigger an OS dump.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback