qcow2–>raw

VMDK–>qcow2:

kevin@kevin:~# qemu-img convert -f vmdk -O qcow2 SLES11SP1-single.vmdk SLES11SP1-single.img

http://www.ibm.com/developerworks/cn/linux/l-cn-mgrtvm3/index.html

qcow2–>raw:

kevin@kevin:~$ qemu-img convert -O qcow2 image-raw.raw image-raw-converted.qcow

本文转自:http://blog.prajnagarden.com/?p=248

閱讀全文

分類: RouterOS | 發佈留言

To create a qemu guest with more than one nic, just repeat the -net commands

To create a qemu guest with more than one nic, just repeat the -net commands

qemu -net tap,vlan=0,ifname=tap0,script=./qemu-ifup -net nic,vlan0 \ -net tap,vlan=0,ifname=tap1,script=./qemu-ifup -net nic,vlan0 \ -net tap,vlan=0,ifname=tap2,script=./qemu-ifup -net nic,vlan0 \ -boot d -cdrom alpine*.iso}}

 

 

 

qemu-system-x86_64 rhel6u3.img -smp 2 -m 1024 -net nic -nettap,ifname=tap1,script=/etc/qemu-ifup,downscript=no -vnc :0 -daemonize


							
分類: RouterOS | 發佈留言

從無到有,搞定你的RouterOS讓它能連上網路.

假如你的RouterOS是x86安裝的,或是可能某些硬體沒有出廠的預設值,

底下的圖文教學協助你讓你的RouterOS可以連上網路並透過它上網.

如果是routerboard系列的原廠機器,現在不需要這麼麻煩了,

原廠內建快速設定頁面,新機器只需要透過瀏覽器或是WINBOX填入相關的資訊即可連線上網.

閱讀全文

分類: RouterOS | 7 則留言

UniFi Controller AC控制器安裝SSL證書

現在有另外一種更簡單的方法了~

參考這裡網址

 

 

———————–以下是舊文————————

解决每次開啟UniFi Controller AC控制器都會出現

您的連線不是私人連線

的安全性警告畫面.

如底下畫面.

閱讀全文

分類: Ubnt 無線 | 1 則留言

Proxmox 管理虛擬機器 使用「qm」指令 

Proxmox 管理虛擬機器 使用「qm」指令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
qm <command> <vmid> [OPTIONS]
qm [create|set] <vmid>
    --memory  <MBYTES>    memory in MB (64 - 8192)
    --sockets <N>         set number of CPU sockets <N>
    --cores <N>           set cores per socket to <N>
    --ostype NAME         specify OS type
    --onboot [yes|no]     start at boot
    --keyboard XX         set vnc keyboard layout
    --cpuunits <num>      CPU weight for a VM
    --name <text>         set a name for the VM
    --description <text>  set VM description
    --boot [a|c|d|n]      specify boot order
    --bootdisk <disk>     enable booting from <disk>
    --acpi (yes|no)       enable/disable ACPI
    --kvm (yes|no)        enable/disable KVM
    --tdf (yes|no)        enable/disable time drift fix
    --localtime (yes|no)  set the RTC to local time
    --vga (gd5446|vesa)   specify VGA type
    --vlan[0-9u]          MODEL=XX:XX:XX:XX:XX:XX[,MODEL=YY:YY:YY:YY:YY:YY]
    --ide<N>              [volume=]volume,[,media=cdrom|disk]
                          [,cyls=c,heads=h,secs=s[,trans=t]]
                          [,cache=none|writethrough|writeback]
                          [,snapshot=on|off][,cache=on|off][,format=f]
                          [,werror=enospc|ignore|report|stop]
                          [,rerror=ignore|report|stop]
                          [,backup=no|yes]
    --ide<N> <GBYTES>     create new disk
    --ide<N> delete       remove drive - destroy image
    --ide<N> undef        remove drive - keep image
    --cdrom <file>        is an alias for --ide2 <file>,media=cdrom
    --scsi<N>             [volume=]volume,[,media=cdrom|disk]
                          [,cyls=c,heads=h,secs=s[,trans=t]]
                          [,snapshot=on|off][,format=f]
                          [,cache=none|writethrough|writeback]
                          [,werror=enospc|ignore|report|stop]
                          [,backup=no|yes]
    --scsi<N> <GBYTES>    create new disk
    --scsi<N> delete      remove drive - destroy image
    --scsi<N> undef       remove drive - keep image
    --virtio<N>           [volume=]volume,[,media=cdrom|disk]
                          [,cyls=c,heads=h,secs=s[,trans=t]]
                          [,snapshot=on|off][,format=f]
                          [,cache=none|writethrough|writeback]
                          [,werror=enospc|ignore|report|stop]
                          [,rerror=ignore|report|stop]
                          [,backup=no|yes]
    --virtio<N> <GBYTES>  create new disk
    --virtio<N> delete    remove drive - destroy image
    --virtio<N> undef     remove drive - keep image
qm monitor <vmid>       connect to vm control monitor
qm start <vmid>         start vm
qm shutdown <vmid>      gracefully stop vm (send poweroff)
qm wait <vmid> [time]   wait until vm is stopped
qm stop <vmid>          kill vm (immediate stop)
qm reset <vmid>         reset vm (stop, start)
qm suspend <vmid>       suspend vm
qm resume <vmid>        resume vm
qm cad <vmid>           sendkey ctrl-alt-delete
qm destroy <vmid>       destroy vm (delete all used/owned volumes)
qm unlock <vmid>        clear migrate/backup lock
qm status <vmid>        shows the container status
qm cdrom <vmid> [<device>] <path>  set cdrom path. <device is ide2 by default>
qm cdrom <vmid> [<device>] eject   eject cdrom
qm unlink <vmid> <volume>  delete unused disk images
qm vncproxy <vmid> <ticket>  open vnc proxy
qm vnc <vmid>           start (X11) vncviewer (experimental)
qm showcmd <vmid>       show command line (debug info)
qm list                 list all virtual machines
qm startall             start all virtual machines (when onboot=1)
qm stopall [timeout]    stop all virtual machines (default timeout is 3 minutes)
分類: RouterOS | 發佈留言

Queues – PCQ Examples

Manual:Queues – PCQ Examples

Per Connection Queue (PCQ) is a queuing discipline that can be used to dynamically equalize or shape traffic for multiple users, using little administration. It is possible to divide PCQ scenarios into three major groups: equal bandwidth for a number of users, certain bandwidth equal distribution between users, unknown bandwidth equal distribution between users.

Equal Bandwidth for a Number of Users

Use PCQ type queue when you need to equalize the bandwidth [and set max limit] for a number of users. We will set the 64kbps download and 32kbps upload limits.

PCQ.png

There are two ways how to make this: using mangle and queue trees, or, using simple queues.

1. Mark all packets with packet-marks upload/download: (lets constider that ether1-LAN is public interface to the Internet and ether2-LAN is local interface where clients are connected

/ip firewall mangle add chain=prerouting action=mark-packet \
   in-interface=ether1-LAN new-packet-mark=client_upload
/ip firewall mangle add chain=prerouting action=mark-packet \
   in-interface=ether2-WAN new-packet-mark=client_download

2. Setup two PCQ queue types – one for download and one for upload. dst-address is classifier for user’s download traffic, src-address for upload traffic:

/queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address

3. Finally, two queue rules are required, one for download and one for upload:

/queue tree add parent=global-in queue=PCQ_download packet-mark=client_download
/queue tree add parent=global-out queue=PCQ_upload packet-mark=client_upload

If you don’t like using mangle and queue trees, you can skip step 1, do step 2, and step 3 would be to create one simple queue as shown here:

/queue simple add target-addresses=192.168.0.0/24 queue=PCQ_upload/PCQ_download
分類: RouterOS | 發佈留言

[Ubuntu] ConohaのVPSのUbuntuで2つ目のHDDをマウントする

[Ubuntu] ConohaのVPSのUbuntuで2つ目のHDDをマウントする

ConohaのVPSでは、ディスク領域がDisk1, Disk2の2つのパーティションに分割され、Disk1にOSがインストールされます。

デフォルトのCent OSを利用する場合は、Disk2が/dataに自動でマウントされるようですが、Ubuntuを上書きでインストールした場合にはDisk2が自動ではマウントされませんでした。

以下のコマンドを実行することで、Disk2をマウント可能です。

1. Disk2のフォーマット

Disk2は通常/dev/vdbとして認識されているので、これをext4形式にフォーマットします。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ sudo mkfs.ext4 /dev/vdb
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214400 blocks
1310720 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

2. マウントできるかを確認

フォーマットしたDisk2を/dataにマウントできるかを確認します。

1
2
3
4
5
6
7
8
9
10
11
12
$ sudo mkdir /data
$ sudo mount /dev/vdb /data/
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        97G  1.9G   90G   3% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            991M  4.0K  991M   1% /dev
tmpfs           201M  380K  200M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none           1001M     0 1001M   0% /run/shm
none            100M     0  100M   0% /run/user
/dev/vdb         99G   60M   94G   1% /data

自動マウント設定をするため、一旦アンマウントします。

1
$ sudo umount /data

3. 起動時に自動でマウントされるように設定

Disk2のUUIDを確認します。

1
2
3
4
$ sudo -i blkid
/dev/vda1: UUID="UUIDその1" TYPE="ext4"
/dev/vda5: UUID="UUIDその2" TYPE="swap"
/dev/vdb: UUID="このUUIDをコピー" TYPE="ext4"

fstabに追記します。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ sudo vi /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/vda1 during installation
UUID=UUIDその1                            /               ext4    errors=remount-ro 0       1
# swap was on /dev/vda5 during installation
UUID=UUIDその2                            none            swap    sw              0       0
# データ領域のマウント
UUID=先ほどコピーしたUUID                 /data           ext4    defaults        1       2
分類: RouterOS | 發佈留言

MySql 修改 root 密碼 (忘記密碼)

必須重新啟動 mysql 並且進入安全模式,即可以root不需要 密碼登入。

[root@ros~]# service mysql  stop
[root@ros~]# mysqld_safe –user=mysql –skip-grant-tables –skip-networking &
mysql> UPDATE user SET Password=PASSWORD(‘這裡填你要重設的密碼’) where USER=‘root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
搞定

 

閱讀全文
分類: RouterOS | 發佈留言

RB系列Master-Port作用(舊版OS v6.41rc1以前)

(目前新版自v6.41rc1以後已經不用Master-Port的方式,已全部改由Bridge方式設定橋接)

如果你是新版的系統,請直接忽略這篇文章.

閱讀全文

分類: RouterOS | 4 則留言

MikroTik 高階路由器CCR1009-8G-1S-1S+PC (無風扇設計)

  •  9核心免風扇設計.

  • 透過導熱管及大型散熱片散熱,完全無聲.

  • 電源是由24v 2.5A AC/DC變壓器提供,也支援從第八口(ETH8)POE輸入.

  • 這台機器屬於桌上型設計,同時有附專門機架固定的耳朵(長的),可固定在機架上面.

  • 1G跟10G SFP光口各一.

Product specifications

Details
Product code CCR1009-8G-1S-1S+PC
CPU nominal frequency 1 GHz
CPU core count 9
Size of RAM 2 GB
10/100 Ethernet ports None
10/100/1000 Ethernet ports 8
MiniPCI slots 0
MiniPCI-e slots 0
Number of USB ports 1
Power Jack 1
PoE in Yes
PoE out No
Supported input voltage 14 V – 57 V
Voltage Monitor Yes
PCB temperature monitor Yes
CPU temperature monitor Yes
Dimensions 272x190x47mm
Operating System RouterOS
License level 6
Current Monitor Yes
CPU TLR4-00980CG-10CE-A3a
Max Power consumption 30W
SFP ports 1
SFP+ ports 1
USB slot type microUSB type AB
Serial port RS232

 

Performance test results

CCR1009-8G-1S-1S+PC Tile 9 core all port test
Mode Configuration 64 byte 512 byte 1518 byte
kpps Mbps kpps Mbps kpps Mbps
Bridging none (fast path) 13,085.9 6,700.0 2,819.3 11,547.9 975.1 11,841.6
Bridging 25 bridge filter rules 1,135.3 581.3 1,099.7 4,504.4 975.1 11,841.6
Routing none (fast path) 8,389.0 4,295.2 2,819.3 11,547.9 975.1 11,841.6
Routing 25 simple queues 1,628.0 833.5 1,541.9 6,315.6 975.1 11,841.6
Routing 25 ip filter rules 739.7 378.7 726.9 2,977.4 648.2 7,871.7
  1. All tests are done with Xena Networks specialized test equipment (XenaBay),and done according to RFC2544 (Xena2544)
  2. Max throughput is determined with 30+ second attempts with 0,1% packet loss tolerance in 64, 512, 1518 byte packet sizes
  3. Values in Italic indicate that max throughput was reached without maxing out CPU, but because board interface configuration was maxed out
  4. Test results show device maximum performance, and are reached using mentioned hardware and software configuration, different configurations most likely will result in lower results

附屬配件

 

 

羅園長家的機器照片參考 

分類: RouterOS | 2 則留言