What is disk modification?

[更新: 2019年6月27日]

This page explains the disk modification function of SAKURA Cloud.

1. Overview

When creating a disk based on a public archive provided by our company, you can use disk modification function to change the network in the public archive and files configured with passwords to your own specifications. This makes use possible without the need to change settings after creating the server.

For example, in cases such as creating a disk at the same time as creating a server, this function enables use as a completely setup server simply by setting the desired values to the disk created at the control panel.

Attention

The function is intended for use in copying from the public archive to a disk, or for use on disks without significant changes to partition information and other contents after creation using the aforementioned copying method. Therefore, the function may not operate if a disk was created from an archive created by the customer, or if significant changes were made to the partition or other disk contents.
*LVM is no longer supported as of April 11, 2019. From this date, the function will no longer work for customers who had previously used the function in an LVM environment. Also, in conjunction with these changes to specifications, the only operation that is covered by operation warranty is the first copy from the public archive to the disk.

Supported disks

さくらのクラウドが提供するパブリックアーカイブのうち、CentOS、Debian、Ubuntu、FreeBSD、CoreOS、Windows、RancherOS、k3OSの各OSのパブリックアーカイブからコピーされたディスク、または内部でCentOSを採用しているKUSANAGIの各バージョンとなります。

*For details on the disk modification function for Windows, please refer to This page.
*For details on the disk modification function for RancherOS, please refer to This page .

Attention

Support is not available for disks which were created from a source other than the public archive provided by SAKURA Cloud; for example, disks for which the customer used an ISO image to install the OS.

2. How to use the disk modification function

Perform the following procedures to use the disk modification function.

  • When creating a server, insert a check into the checkbox for [Modify Disk] at the settings screen.
  • At the disk menu, select [Modify Disk] for modification.

*Cannot be used if the server to which the disk is connected is turned on or if the disk is connected to the server.

3. Items which are modified using the disk modification function (modification items for which settings can be specified)

Disk modification includes items for which settings are explicitly specified by the user and items which are automatically modified by the disk modification function. Items which can be set by the user are listed below.

◆Modifications that can be specified by the user

Modifications that can be specified by the user are shown below. It is possible to specify modification details at the form at the control panel.

IP address, netmask, default gateway (at the time of router + switch/switch connection)

When the disk targeted for modification is connected to the server, the IP address specified for that server is set to become valid at the time of server startup. The IP address, netmask, and default gateway, which are to be specified to the disk, can be set at the disk modification screen.

When DHCP has been selected, set the IP address at the DHCP.

CentOS 6.x Set the IP address and netmask to /etc/sysconfig/network-script/ifcfg-eth0, and set the gateway to /etc/sysconfig/network.
CentOS 7.x Set to /etc/sysconfig/network-script/ifcfg-eth0.
Debian, Ubuntu 18.04 LTS and prior Set to /etc/network/interfaces.
Ubuntu 18.04 LTS and later Set to /etc/netplan/01-netcfg.yaml.
FreeBSD Set to /etc/rc.conf.
CoreOS Set to cloud-config.yml.
k3OS /var/lib/rancher/k3os/config.yaml に設定します

Host name

Name registered as the hostname of the server

CentOS 6.x Set the variable HOSTNAME for /etc/sysconfig/network.
CentOS 7.x, Debian, Ubuntu Set to /etc/hostname.
FreeBSD Set the variable hostname for /etc/rc.conf.
CoreOS Set to cloud-config.yml.
k3OS /var/lib/rancher/k3os/config.yaml に設定します

Password

管理者アカウントのパスワードです。多くのOSではrootのパスワードです。Ubuntuでは、ユーザ「ubuntu」のパスワードとなります。また、k3OSでは、ユーザ「rancher」のパスワードとなります。

Public key

Add the specified public key to .ssh/authorized_keys in the home directory of the admin account.

Disable SSH login using the password.

When the public key is selected, it is possible to select the item [Do not Allow SSH Login with Password Authentication/Challenge-Response]. For details, please refer to FAQ (security items).

Startup script

Specify settings to copy the specified startup script and then perform startup. This function cannot be used for CoreOS.

Change the partition UUID

Change the UUID of the route partition file system. Also, for /etc/fstab and the following file’s UUID, overwrite to the UUID after the change.

CentOS 6.x /boot/grub/menu.lst
CentOS 7.x /boot/grub2/grub.cfg
Ubuntu, Debian /boot/grub/grub.cfg

*Only the operating systems listed above are supported.
*Modification is only possible at the time of disk modification when creating a new disk. This modification is not possible for a disk that has already been created.
*This modification is not possible when a partition with a mount point used for “/boot” is created.

◆Modifications made automatically

The following items are modified automatically regardless of user specifications.

IP address, netmask, default gateway (during shared segment connection)

When the disk targeted for modification is connected to the server, the IP address specified for that server is set to become valid at the time of server startup. The IP address is assigned by the system and cannot be assigned by the user.

CentOS 6.x Set the IP address and netmask to /etc/sysconfig/network-script/ifcfg-eth0, and set the gateway to /etc/sysconfig/network.
CentOS 7.x Set to /etc/sysconfig/network-script/ifcfg-eth0.
Debian, Ubuntu 18.04 LTS and prior Set to /etc/network/interfaces.
Ubuntu 18.04 LTS and later Set to /etc/netplan/01-netcfg.yaml.
FreeBSD Set to /etc/rc.conf.
CoreOS Set to cloud-config.yml.
k3OS /var/lib/rancher/k3os/config.yaml に設定します

resolv.conf

When the disk targeted for modification is connected to the server, set a name server appropriate for that server. The specified name server is the same as the one which can be confirmed at the NIC tab on the control panel. At the same time “search localdomain” is set for resolv.conf.

crontab

Change settings for crontab so that housekeeping jobs (scripts executed on a daily, weekly, and monthly basis) that are periodically executed by the system do not start in a batch at a certain time.

CentOS 6.x/7.x Set the RANDOM_DELAY value for /etc/anacrontab to 240.

Attention

This is mainly a measure for randomizing the periodic startup time at old OSs in order to prevent simultaneous disk access by multiple virtual servers.

4. Cautions

When disk modification fails

When copying to a disk from an archive created by the customer, or when using the disk modification function at the same time as copying a disk, there are cases in which disk modification fails due to installation from unsupported operating systems and ISO images, or due to source conditions such as changed specifications for file name, setting items, etc., depending on operating system version upgrades after installation. In such cases, the following error message is displayed and work is interrupted.

When stopped, copying is interrupted.

Confirm that the resource status for the applicable disk is [Failed] and then delete the disk.

*If disk modification fails, the operating system is not supported. Therefore, please copy the disk without using the disk modification function.

Judgment for executing disk modification

The disk modification function works when the disk targeted for modification satisfies the following specifications. In some cases, even for disks which were copied from a public archive, the disk modification function will not work if the following conditions are not satisfied due to changes to settings during operation, etc.

CentOS

  • The partition type of the last partition in the order must be 8300.
  • The file system of the last partition in the order must be either ext4.
  • File targeted for modification via disk modification must exist in the last partition in the order.
  • The :file: /etc/redhat-release file must exist in the last partition in the order and the contents must not have been changed from the initial condition.

Debian

  • The partition type of the last partition in the order must be 8300.
  • The file system of the last partition in the order must be either ext4.
  • File targeted for modification via disk modification must exist in the last partition in the order.
  • The :file: /etc/debian_version file and :file: /etc/issue file must exist in the last partition in the order and the contents must not have been changed from the initial condition.

Ubuntu

  • The partition type of the last partition in the order must be 8300.
  • The file system of the last partition in the order must be either ext4.
  • File targeted for modification via disk modification must exist in the last partition in the order.
  • The :file: /etc/lsb-release file must exist in the last partition in the order and the contents must not have been changed from the initial condition.

FreeBSD

  • The partition type of the last partition in the order must be A503.
  • The file system of the last partition in the order must be either ufs,
  • File targeted for modification via disk modification must exist in the last partition in the order.
  • The :file: /boot/kernel/kernel file must exist in the last partition in the order and the contents must not have been changed from the initial condition.

CoreOS

  • The partition type for the partition in the 6th position must be 8300.
  • The file system of the last partition in the order must be either ext4,
  • The last partition in the order must be the 9th. The partition type for that partition must be FFFF.
  • The last partition in the order must be the 9th. The file system for that partition must be ext4.
  • The last partition in the order must be the 9th. File targeted for modification via disk modification must exist in that partition.
  • The last partition in the order must be the 9th. The :file: /etc/coreos/update.conf file must exist in that partition and the contents must not have been changed from the initial condition.

RancherOS

  • The partition type of the last partition in the order must be 8300.
  • The file system of the last partition in the order must be either ext4.
  • The directory /var/lib/rancher/conf/cloud-config.d must exist in the last partition in the order.

k3OS

  • The partition type of the last partition in the order must be 8300.
  • The file system of the last partition in the order must be either ext4.
  • 最後の位置のパーティションに /k3os/system ディレクトリが存在すること

*You can check the partition type by using the command sgdisk -p /dev/<Target block device> in the Linux environment, etc.
*Even when not using a public archive released by our company, if the disk created by the customer fulfills the following conditions, there are cases in which it is possible to use the disk modification function. However, our company does not guarantee operation. In such cases, the customer assumes responsibility for executing the function.