Help Center> Intelligent EdgeCloud> User Guide> Common Operations> Deleting Files in the Network Rule Directory

Deleting Files in the Network Rule Directory

Scenarios

To prevent NIC name drift on the edge instance you will create using a private image, you need to delete files in the network rule directory of the VM where the source edge instance is located during the private image creation.

Prerequisites

The xen-pv and virtio drivers have been installed on the edge instance.

Procedure

  1. View the files in the network rule directory.

    ls -l /etc/udev/rules.d

  2. Delete the files with both persistent and net included in file names from the network rule directory.

    Example:

    rm /etc/udev/rules.d/30-net_persistent-names.rules

    rm /etc/udev/rules.d/70-persistent-net.rules

    The italic content in the commands varies depending on your environment.

    For CentOS 6 images, to prevent NIC name drift, you need to create an empty rules configuration file.

    Example:

    touch /etc/udev/rules.d/75-persistent-net-generator.rules //Replace 75 with the actual value in the environment.

  3. Delete network rules.

    • If the OS uses the initrd system image, perform the following operations:
      1. Check whether the initrd image file whose name starts with initrd and ends with default contains the persistent and net network device rule files (replace the italic content in the following command with the actual OS version).

        lsinitrd /boot/initrd-2.6.32.12-0.7-default |grep persistent|grep net

        • If no, no further action is required.
        • If yes, go to 3.b.
      2. Back up the initrd image files (replace the italic part in the following command with the actual OS version).

        cp /boot/initrd-2.6.32.12-0.7-default /boot/initrd-2.6.32.12-0.7-default_bak

      3. Generate the initrd file again.

        mkinitrd

    • If the OS uses the initramfs system image (such as Ubuntu), perform the following operations:
      1. Check whether the initramfs image file whose name starts with initrd and ends with generic contains the persistent and net network device rule files.

        lsinitramfs /boot/initrd.img-3.19.0-25-generic|grep persistent|grep net

        • If no, no further action is required.
        • If yes, go to 3.b.
      2. Back up the initrd image files.

        cp /boot/initrd.img-3.19.0-25-generic /boot/initrd.img-3.19.0-25-generic_bak

      3. Generate the initramfs image file again:

        update-initramfs -u