LoginSignup
30
27

More than 5 years have passed since last update.

IDCFクラウドS1を月額220円運用

Last updated at Posted at 2015-12-04

本記事はIDCF Cloud Advent Calendar 2015の5日目の記事です。

IDCFクラウドの特徴


220円(税抜き)仮想マシン作成方法

  • ストレージが20円/GB(税抜き)で利用できる。

vmcreate.png

  • 通常だと500円/月(税抜き) と表示される

500.png

  • ISOを利用、DISK 1GBの場合、220円/月(税抜き) となる。

「ISOインポート」はISOをインポート時の転送量については無料となっており、
インポートされた後、「ISO保存」としてISOの「ファイル容量 * 0.06円/GB」の
ご利用料金が発生いたします。

220.png

Debian8.2を1GBにインストール

  • 1GBだとCoreOSがインストール完了できなかった。
  • Debian8.2はbtrfsを選択したところインストールできた。
  • CD Bootさせるboot2dockerやRancherOSでは1GBでも動作する。
  • RancherOSのdebian-console使うのも良い。

btrfs

btrfs使い方
# フォーマット
mkfs.btrfs /dev/sda2
# 圧縮オプション付きでマウント
mount -o compress=lzo /dev/sda2 /mnt
# 再圧縮
btrfs filesystem defragment -r -v -clzo /
  • btrfs で 「sshサーバ」のみチェックを入れてインストールを完了したところ、
    • / の使用量が612MBだった。
    • 圧縮かけたところ 567M になった。

ポートフォワード

  • ファイアウォールの通信許可と、ポートフォワーディングの設定が必要

fw.png

portfw.png


テンプレート(OVA)

  • 注意点は以下。

外部の仮想マシンイメージをインポートすることはできますか?
http://www.idcf.jp/cloud/faq/sna_003.html

外部の仮想マシンイメージをインポートする際の注意点
http://www.idcf.jp/cloud/faq/sna_045.html
・イメージを持ち込む元となる仮想マシンのCD-ROMデバイスの接続先が、SATAとなっている場合は、
 IDEに変更してから、テンプレート化し、インポートしてください。

・イメージを持ち込む元となる仮想マシンで、ISOをアタッチしている場合は、
 CD-ROMをクライアントデバイスに設定するなど、何もアタッチしていない状態で
テンプレート化し、インポートしてください。

dl.png

  • テンプレートイメージサイズ分課金される

use.png


ISOでboot2docker.isoを使う

  • boot2dockerをダウンロードし一旦httpサーバにUPLOADした。
  • Clonezilla使ってイメージ復元も面白いかも
1GBをフォーマットし使えるようにする
swapoff /dev/sda1
fdisk /dev/sda
mkfs.ext4 -L boot2docker-data /dev/sda1
reboot

sda1.png

sudoers.png

ISOをDISKにインストール

dd if=boot2docker.iso of=/dev/sda

再起動するとboot2dockerが起動してくることを確認。

DISKの設定

fdisk /dev/sda
  • n > p > 2 > Enter > Enter > w
mkfs.ext4 -L boot2docker-data /dev/sda2

再起動すると以下が使われだす。

  • /mnt/sd2/var/lib/docker/
  • /mnt/sda2/var/lib/boot2docker/

任意のスクリプト実行

/var/lib/boot2docker/bootlocal.sh
#ip link set eth0 up
#ip addr add 192.168.58.166 dev eth0
#ip route add 192.168.58.0/24 dev eth0
#ip route add default via 192.168.58.1

echo nameserver 8.8.8.8 >> /etc/resolv.conf

nginx起動してみる

  • :の入力がうまく行かない場合はKeyboard設定を英語にすると良い。

keyboard.png

  • webページが表示できることを確認。

nginx.png

disk使用量

df.png


UnixBench

機種 Score CPU
CloudAtCost 549.6 Xeon(R) CPU X7560@2.27GHz
LivaPC 538.4 CeleronN2806 1.60GHz
IDCF-S1 423.8 Xeon(R) CPU E5-2680 v2 0.8GHz 1CPU
Scaleway 354.0 armv7l 4CPU
RaspberryPi2 306.5 armv7l 4CPU
RaspberryPi 100.9 armv6l 1CPU
計測
docker run -it tukiyo3/centos7-unixbench

bench.png

make all
make[1]: Entering directory `/opt/UnixBench'
Checking distribution of files
./pgms  exists
./src  exists
./testdir  exists
./tmp  exists
./results  exists
make[1]: Leaving directory `/opt/UnixBench'
sh: 3dinfo: command not found
sh: runlevel: command not found

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

Use of uninitialized value in sprintf at ./Run line 598.
Use of uninitialized value in sprintf at ./Run line 1507.
Use of uninitialized value in printf at ./Run line 1366.
Use of uninitialized value in printf at ./Run line 1559.

1 x Dhrystone 2 using register variables  1 2 3 4 5 6 7 8 9 10

1 x Double-Precision Whetstone  1 2 3 4 5 6 7 8 9 10

1 x Execl Throughput  1 2 3

1 x File Copy 1024 bufsize 2000 maxblocks  1 2 3

1 x File Copy 256 bufsize 500 maxblocks  1 2 3

1 x File Copy 4096 bufsize 8000 maxblocks  1 2 3

1 x Pipe Throughput  1 2 3 4 5 6 7 8 9 10

1 x Pipe-based Context Switching  1 2 3 4 5 6 7 8 9 10

1 x Process Creation  1 2 3

1 x System Call Overhead  1 2 3 4 5 6 7 8 9 10

1 x Shell Scripts (1 concurrent)  1 2 3

1 x Shell Scripts (8 concurrent)  1 2 3

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: : GNU/Linux
   OS: GNU/Linux -- 4.1.13-boot2docker -- #1 SMP Fri Nov 20 19:05:50 UTC 2015
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz (5600.0 bogomips)
          x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   03:02:39 up 1 min,  0 users,  load average: 0.40, 0.17, 0.06; runlevel 

------------------------------------------------------------------------
Benchmark Run: Wed Dec 02 2015 03:02:39 - 03:31:53
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       12051868.9 lps   (10.1 s, 7 samples)
Double-Precision Whetstone                     1151.4 MWIPS (12.8 s, 7 samples)
Execl Throughput                                798.7 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        193670.1 KBps  (30.1 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           49941.2 KBps  (30.1 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        580199.2 KBps  (30.1 s, 2 samples)
Pipe Throughput                              737667.7 lps   (10.1 s, 7 samples)
Pipe-based Context Switching                 116522.8 lps   (10.1 s, 7 samples)
Process Creation                               3757.8 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                   1362.5 lpm   (60.2 s, 2 samples)
Shell Scripts (8 concurrent)                    198.6 lpm   (60.3 s, 2 samples)
System Call Overhead                        1551262.9 lps   (10.1 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   12051868.9   1032.7
Double-Precision Whetstone                       55.0       1151.4    209.3
Execl Throughput                                 43.0        798.7    185.7
File Copy 1024 bufsize 2000 maxblocks          3960.0     193670.1    489.1
File Copy 256 bufsize 500 maxblocks            1655.0      49941.2    301.8
File Copy 4096 bufsize 8000 maxblocks          5800.0     580199.2   1000.3
Pipe Throughput                               12440.0     737667.7    593.0
Pipe-based Context Switching                   4000.0     116522.8    291.3
Process Creation                                126.0       3757.8    298.2
Shell Scripts (1 concurrent)                     42.4       1362.5    321.3
Shell Scripts (8 concurrent)                      6.0        198.6    331.0
System Call Overhead                          15000.0    1551262.9   1034.2
                                                                   ========
System Benchmarks Index Score                                         423.8
/proc/cpuinfo
$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 58
model name  : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping    : 0
microcode   : 0x428
cpu MHz     : 2799.999
cache size  : 25600 KB
physical id : 0
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb pln pts dtherm fsgsbase smep
bugs        :
bogomips    : 5599.99
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:
free
$ free -m
              total        used        free      shared  buff/cache   available
Mem:            996          32         779         124         183         812
Swap:           210           0         210

RancherOSをCDブートで運用

Virtualboxを1GBのDebian8.2にインストールする手順

  • IDCFクラウドではVirtualboxの起動ができる。
  • 以下Virtualbox5の依存パッケージを先に入れてからvirtualbox-5.0_5.0.10-104061~Debian~jessie_amd64.debをインストールしないと空き容量が足りなくなる。

ca-certificates dbus file fontconfig libasound2 libasound2-data libasyncns0 libaudio2 libavahi-client3 libavahi-common-data libavahi-common3 libcaca0 libcap-ng0 libcups2 libcurl3-gnutls libdbus-1-3 libdirectfb-1.2-9 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libelf1 libflac8 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib2.0-0 libglib2.0-data libice6 libjbig0 libjpeg62-turbo liblcms2-2 libldap-2.4-2 libllvm3.5 libmagic1 libmng1 libogg0 libpciaccess0 libpulse0 libpython2.7 libpython2.7-minimal libpython2.7-stdlib libqt4-opengl libqtcore4 libqtgui4 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsdl1.2debian libsm6 libsndfile1 libsqlite3-0 libssh2-1 libtiff5 libtxc-dxtn-s2tc0 libvorbis0a libvorbisenc2 libvpx1 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-sync1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 libxml2 libxmu6 libxrender1 libxshmfence1 libxt6 libxtst6 libxxf86vm1 mime-support openssl psmisc qtcore4-l10n sgml-base shared-mime-info xdg-user-dirs xml-core

  • OVFファイルを読み込むと上記エラーになった場合、USBをDISABLE、ENABLEにすると解決。

A new node couldn't be inserted because one with the same name exists. (VERR_CFGM_NODE_EXISTS).

  • /etc/apt/sources.list を以下のようにdeb-srcをコメントアウトしておくと容量が削減できる。
/etc/apt/sources.list
deb http://ftp.tsukuba.wide.ad.jp/debian/ jessie main
#deb-src http://ftp.tsukuba.wide.ad.jp/debian/ jessie main

deb http://security.debian.org/ jessie/updates main contrib non-free
#deb-src http://security.debian.org/ jessie/updates main contrib non-free

# jessie-updates, previously known as 'volatile'
deb http://ftp.tsukuba.wide.ad.jp/debian/ jessie-updates main contrib non-free
#deb-src http://ftp.tsukuba.wide.ad.jp/debian/ jessie-updates main contrib non-free

Virtualboxを1GBのArch Linuxにインストールする手順

Virtualboxインストール済みArch Linux 1CD作成方法


おわりに

  • VPS界で一番安い(一番低いスペックで比較)。低速でいいのでDISKの値段下がらないかな。。
30
27
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
27