<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 167,  comments - 30,  trackbacks - 0
    使用開源云工具OpenNebula3.8.1在KVM環(huán)境下虛擬機遷移失敗問題解決。
    1、虛擬機遷移失敗1日志:
    Fri Mar  8 17:57:18 2013 [LCM][I]: New VM state is SAVE_MIGRATE
    Fri Mar  8 17:57:30 2013 [VMM][I]: ExitCode: 0
    Fri Mar  8 17:57:30 2013 [VMM][I]: Successfully execute virtualization driver operation: save.
    Fri Mar  8 17:57:30 2013 [VMM][I]: ExitCode: 0
    Fri Mar  8 17:57:30 2013 [VMM][I]: Successfully execute network driver operation: clean.
    Fri Mar  8 17:58:14 2013 [LCM][I]: New VM state is PROLOG_MIGRATE
    Fri Mar  8 17:58:14 2013 [TM][I]: mv: -------------------------/one_images_3.8.1/0/42/disk.0
    Fri Mar  8 17:58:14 2013 [TM][I]: ExitCode: 0
    Fri Mar  8 18:02:28 2013 [TM][I]: mv: Moving bcec162:/one_images_3.8.1/0/42 to node153:/one_images_3.8.1/0/42
    Fri Mar  8 18:02:28 2013 [TM][I]: ExitCode: 0
    Fri Mar  8 18:02:29 2013 [LCM][I]: New VM state is BOOT
    Fri Mar  8 18:02:30 2013 [VMM][I]: ExitCode: 0
    Fri Mar  8 18:02:30 2013 [VMM][I]: Successfully execute network driver operation: pre.
    Fri Mar  8 18:02:33 2013 [VMM][I]: Command execution fail: /var/tmp/one/vmm/kvm/restore /one_images_3.8.1/0/42/checkpoint node153 42 node153
    Fri Mar  8 18:02:33 2013 [VMM][E]: restore: Command "virsh --connect qemu:///system restore /one_images_3.8.1/0/42/checkpoint" failed: error: Failed to restore domain from /one_images_3.8.1/0/42/checkpoint
    Fri Mar  8 18:02:33 2013 [VMM][I]: error: unable to set user and group to '0:0' on '/one_images_3.8.1/0/42/disk.1': No such file or directory
    Fri Mar  8 18:02:33 2013 [VMM][E]: Could not restore from /one_images_3.8.1/0/42/checkpoint
    Fri Mar  8 18:02:33 2013 [VMM][I]: ExitCode: 1
    Fri Mar  8 18:02:33 2013 [VMM][I]: Failed to execute virtualization driver operation: restore.
    Fri Mar  8 18:02:33 2013 [VMM][E]: Error restoring VM: Could not restore from /one_images_3.8.1/0/42/checkpoint
    Fri Mar  8 18:02:34 2013 [DiM][I]: New VM state is FAILED
    Sat Mar  9 09:23:46 2013 [DiM][I]: New VM state is DONE.
    Sat Mar  9 09:23:46 2013 [TM][W]: Ignored: LOG I 42 ExitCode: 0
    Sat Mar  9 09:23:47 2013 [TM][W]: Ignored: LOG I 42 delete: Deleting /one_images_3.8.1/0/42
    Sat Mar  9 09:23:47 2013 [TM][W]: Ignored: LOG I 42 ExitCode: 0
    Sat Mar  9 09:23:47 2013 [TM][W]: Ignored: TRANSFER SUCCESS 42 -
    解決方法:
    在mv腳本中TAR拷貝命令前面增加$SUDO命令.
    $ONE_LOCATION/var/remotes/tm/ssh/mv
    #!/bin/bash
    # -------------------------------------------------------------------------- #
    # Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org)             #
    #                                                                            #
    # Licensed under the Apache License, Version 2.0 (the "License"); you may    #
    # not use this file except in compliance with the License. You may obtain    #
    # a copy of the License at                                                   #
    #                                                                            #
    # http://www.apache.org/licenses/LICENSE-2.0                                 #
    #                                                                            #
    # Unless required by applicable law or agreed to in writing, software        #
    # distributed under the License is distributed on an "AS IS" BASIS,          #
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
    # See the License for the specific language governing permissions and        #
    # limitations under the License.                                             #
    #--------------------------------------------------------------------------- #
    # MV <hostA:system_ds/disk.i|hostB:system_ds/disk.i> vmid dsid
    #    <hostA:system_ds/|hostB:system_ds/>
    #   - hostX is the target host to deploy the VM
    #   - system_ds is the path for the system datastore in the host
    #   - vmid is the id of the VM
    #   - dsid is the target datastore (0 is the system datastore)
    SRC=$1
    DST=$2
    VMID=$3
    DSID=$4
    if [ -z "${ONE_LOCATION}" ]; then
        TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
    else
        TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
    fi
    . $TMCOMMON
    #-------------------------------------------------------------------------------
    # Return if moving a disk, we will move them when moving the whole system_ds
    # directory for the VM
    #-------------------------------------------------------------------------------
    SRC=`fix_dir_slashes $SRC`
    DST=`fix_dir_slashes $DST`
    SRC_PATH=`arg_path $SRC`
    DST_PATH=`arg_path $DST`
    SRC_HOST=`arg_host $SRC`
    DST_HOST=`arg_host $DST`
    DST_DIR=`dirname $DST_PATH`
    SRC_DS_DIR=`dirname  $SRC_PATH`
    SRC_VM_DIR=`basename $SRC_PATH`
    if [ `is_disk $DST_PATH` -eq 1 ]; then
        log "-------------------------$DST_PATH"
    exit 0
    fi
    if [ "$SRC" == "$DST" ]; then
        exit 0
    fi
    ssh_make_path "$DST_HOST" "$DST_DIR"
    log "Moving $SRC to $DST"
    ssh_exec_and_log "$DST_HOST" "rm -rf '$DST_PATH'" \
        "Error removing target path to prevent overwrite errors"
    TAR_COPY="$SSH $SRC_HOST '$SUDO $TAR -C $SRC_DS_DIR -cf - $SRC_VM_DIR'"
    TAR_COPY="$TAR_COPY | $SSH $DST_HOST '$TAR -C $DST_DIR -xf -'"
    exec_and_log "eval $TAR_COPY" "Error copying disk directory to target host"
    exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH"
    exit 0
    -------------------------------------------------------------------------------------------
    2、虛擬機遷移失敗2日志:
    Sat Mar  9 09:34:12 2013 [LCM][I]: New VM state is SAVE_MIGRATE
    Sat Mar  9 09:34:24 2013 [VMM][I]: ExitCode: 0
    Sat Mar  9 09:34:24 2013 [VMM][I]: Successfully execute virtualization driver operation: save.
    Sat Mar  9 09:34:24 2013 [VMM][I]: ExitCode: 0
    Sat Mar  9 09:34:24 2013 [VMM][I]: Successfully execute network driver operation: clean.
    Sat Mar  9 09:34:25 2013 [LCM][I]: New VM state is PROLOG_MIGRATE
    Sat Mar  9 09:34:25 2013 [TM][I]: mv: -------------------------/one_images_3.8.1/0/43/disk.0
    Sat Mar  9 09:34:25 2013 [TM][I]: ExitCode: 0
    Sat Mar  9 09:36:38 2013 [TM][I]: mv: Moving node153:/one_images_3.8.1/0/43 to bcec162:/one_images_3.8.1/0/43
    Sat Mar  9 09:36:38 2013 [TM][I]: mv: -------------------target copyy
    Sat Mar  9 09:36:38 2013 [TM][I]: mv: ++++++++++++++++++++++end copy
    Sat Mar  9 09:36:38 2013 [TM][I]: ExitCode: 0
    Sat Mar  9 09:36:38 2013 [LCM][I]: New VM state is BOOT
    Sat Mar  9 09:36:38 2013 [VMM][I]: ExitCode: 0
    Sat Mar  9 09:36:38 2013 [VMM][I]: Successfully execute network driver operation: pre.
    Sat Mar  9 09:36:42 2013 [VMM][I]: Command execution fail: /var/tmp/one/vmm/kvm/restore /one_images_3.8.1/0/43/checkpoint bcec162 43 bcec162
    Sat Mar  9 09:36:42 2013 [VMM][E]: restore: Command "virsh --connect qemu:///system restore /one_images_3.8.1/0/43/checkpoint" failed: error: Failed to restore domain from /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 09:36:42 2013 [VMM][I]: error: internal error process exited while connecting to monitor: Supported machines are:
    Sat Mar  9 09:36:42 2013 [VMM][I]: pc         RHEL 6.0.0 PC (alias of rhel6.0.0)
    Sat Mar  9 09:36:42 2013 [VMM][I]: rhel6.0.0  RHEL 6.0.0 PC (default)
    Sat Mar  9 09:36:42 2013 [VMM][I]: rhel5.5.0  RHEL 5.5.0 PC
    Sat Mar  9 09:36:42 2013 [VMM][I]: rhel5.4.4  RHEL 5.4.4 PC
    Sat Mar  9 09:36:42 2013 [VMM][I]: rhel5.4.0  RHEL 5.4.0 PC
    Sat Mar  9 09:36:42 2013 [VMM][E]: Could not restore from /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 09:36:42 2013 [VMM][I]: ExitCode: 1
    Sat Mar  9 09:36:42 2013 [VMM][I]: Failed to execute virtualization driver operation: restore.
    Sat Mar  9 09:36:42 2013 [VMM][E]: Error restoring VM: Could not restore from /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 09:36:42 2013 [DiM][I]: New VM state is FAILED
    登陸到節(jié)點:
    [root@bcec162 43]# virsh restore checkpoint 
    錯誤:從 checkpoint 恢復(fù)域失敗
    錯誤:internal error process exited while connecting to monitor: Supported machines are:
    pc         RHEL 6.0.0 PC (alias of rhel6.0.0)
    rhel6.0.0  RHEL 6.0.0 PC (default)
    rhel5.5.0  RHEL 5.5.0 PC
    rhel5.4.4  RHEL 5.4.4 PC
    rhel5.4.0  RHEL 5.4.0 PC
    修改了bcec162節(jié)點的/etc/libvirt/qemu.conf文件:
    # The user ID for QEMU processes run by the system instance
    user = "root"
    # The group ID for QEMU processes run by the system instance
    group = "root"
    # Whether libvirt should dynamically change file ownership
    # to match the configured user/group above. Defaults to 1.
    # Set to 0 to disable file ownership changes.
    #dynamic_ownership = 0
    bcec162節(jié)點遷移到node153節(jié)點成功。
    [root@node153 43]# ll
    total 5075464
    -rw-r--r-- 1 root     root  287215779 Mar  8 11:11 checkpoint
    -rw-r--r-- 1 oneadmin kvm   283538737 Mar  9 09:34 checkpoint.1362712278
    -rw-r--r-- 1 oneadmin kvm         920 Mar  9 09:26 deployment.0
    -rw-r--r-- 1 root     root 4621008896 Mar  9 10:14 disk.0
    -rw-r----- 1 root     root     401408 Mar  9 09:26 disk.1
    lrwxrwxrwx 1 oneadmin kvm          29 Mar  9 10:09 disk.1.iso -> /one_images_3.8.1/0/43/disk.1
    --------------------------------------------------------------------------------------------------------
    3、僅修改node152節(jié)點的/etc/libvirt/qemu.conf文件:
    # The user ID for QEMU processes run by the system instance
    #user = "root"
    # The group ID for QEMU processes run by the system instance
    #group = "root"
    # Whether libvirt should dynamically change file ownership
    # to match the configured user/group above. Defaults to 1.
    # Set to 0 to disable file ownership changes.
    dynamic_ownership = 0
    從bcec162節(jié)點遷移到node152不成功,日志如下:
    Sat Mar  9 10:31:47 2013 [LCM][I]: New VM state is SAVE_MIGRATE
    Sat Mar  9 10:31:54 2013 [VMM][I]: save: Moving old checkpoint file /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 10:31:54 2013 [VMM][I]: ExitCode: 0
    Sat Mar  9 10:31:54 2013 [VMM][I]: Successfully execute virtualization driver operation: save.
    Sat Mar  9 10:31:54 2013 [VMM][I]: ExitCode: 0
    Sat Mar  9 10:31:54 2013 [VMM][I]: Successfully execute network driver operation: clean.
    Sat Mar  9 10:31:55 2013 [LCM][I]: New VM state is PROLOG_MIGRATE
    Sat Mar  9 10:31:55 2013 [TM][I]: mv: -------------------------/one_images_3.8.1/0/43/disk.0
    Sat Mar  9 10:31:55 2013 [TM][I]: ExitCode: 0
    Sat Mar  9 10:35:02 2013 [TM][I]: mv: Moving bcec162:/one_images_3.8.1/0/43 to node152:/one_images_3.8.1/0/43
    Sat Mar  9 10:35:02 2013 [TM][I]: mv: -------------------target copyy
    Sat Mar  9 10:35:02 2013 [TM][I]: mv: ++++++++++++++++++++++end copy
    Sat Mar  9 10:35:02 2013 [TM][I]: ExitCode: 0
    Sat Mar  9 10:35:02 2013 [LCM][I]: New VM state is BOOT
    Sat Mar  9 10:35:03 2013 [VMM][I]: ExitCode: 0
    Sat Mar  9 10:35:03 2013 [VMM][I]: Successfully execute network driver operation: pre.
    Sat Mar  9 10:35:07 2013 [VMM][I]: Command execution fail: /var/tmp/one/vmm/kvm/restore /one_images_3.8.1/0/43/checkpoint node152 43 node152
    Sat Mar  9 10:35:07 2013 [VMM][E]: restore: Command "virsh --connect qemu:///system restore /one_images_3.8.1/0/43/checkpoint" failed: error: Failed to restore domain from /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 10:35:07 2013 [VMM][I]: error: operation failed: failed to retrieve chardev info in qemu with 'info chardev'
    Sat Mar  9 10:35:07 2013 [VMM][E]: Could not restore from /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 10:35:07 2013 [VMM][I]: ExitCode: 1
    Sat Mar  9 10:35:07 2013 [VMM][I]: Failed to execute virtualization driver operation: restore.
    Sat Mar  9 10:35:07 2013 [VMM][E]: Error restoring VM: Could not restore from /one_images_3.8.1/0/43/checkpoint
    Sat Mar  9 10:35:07 2013 [DiM][I]: New VM state is FAILED
    登陸到node152節(jié)點執(zhí)行restore命令:
    [root@node152 43]# virsh restore checkpoint
    error: Failed to restore domain from checkpoint
    error: internal error process exited while connecting to monitor: qemu: could not open disk image /one_images_3.8.1/0/43/disk.0: Permission denied
    將/etc/libvirt/qemu.conf文件中注釋掉dynamic_ownership=0,開啟user=root和group=root. 
    如果開啟dynamic_ownership則恢復(fù)虛擬機也會報出上面的錯誤信息。
    在node152節(jié)點上恢復(fù)虛擬機:
    [root@node152 43]# virsh restore checkpoint
    Domain restored from checkpoint
    [root@node152 43]# virsh list
     Id Name                 State
    ----------------------------------
    117 one-43               running
    參考文章:
    https://wiki.archlinux.org/index.php/QEMU_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
    http://hi.baidu.com/juacm/item/f1fc3f98d8428ad07a7f01e2

    轉(zhuǎn)載請保持原鏈接:http://www.tkk7.com/ldwblog/archive/2013/03/08/396187.html
    posted on 2013-03-08 12:03 David1228 閱讀(761) 評論(0)  編輯  收藏 所屬分類: 云計算、虛擬化

    <2013年3月>
    242526272812
    3456789
    10111213141516
    17181920212223
    24252627282930
    31123456

    常用鏈接

    留言簿(4)

    隨筆分類

    隨筆檔案

    文章檔案

    新聞分類

    新聞檔案

    相冊

    收藏夾

    Java

    Linux知識相關(guān)

    Spring相關(guān)

    云計算/Linux/虛擬化技術(shù)/

    友情博客

    多線程并發(fā)編程

    開源技術(shù)

    持久層技術(shù)相關(guān)

    搜索

    •  

    積分與排名

    • 積分 - 358569
    • 排名 - 154

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 成人午夜亚洲精品无码网站| 韩国免费一级成人毛片| 一级做α爱过程免费视频| 国产成人人综合亚洲欧美丁香花 | 国外亚洲成AV人片在线观看| www亚洲精品少妇裸乳一区二区| 国产成人免费A在线视频| 婷婷亚洲天堂影院| 最新国产AV无码专区亚洲| 亚洲人成人一区二区三区| 久久精品国产精品亚洲艾草网| 亚洲欧洲在线观看| 亚洲欧洲中文日产| 亚洲精品国产精品| 黄色a三级三级三级免费看| 国产精品免费久久久久久久久| 久久免费视频一区| 无码人妻久久一区二区三区免费| 99热这里有免费国产精品| 麻豆视频免费播放| 午夜精品在线免费观看| 免费吃奶摸下激烈视频| 亚洲综合色自拍一区| 亚洲免费视频在线观看| 亚洲国产成人手机在线电影bd| 亚洲精品GV天堂无码男同| 免费一级做a爰片久久毛片潮| 岛国岛国免费V片在线观看| 亚洲免费在线播放| 免费观看成人毛片a片2008| 国产一区二区三区在线免费观看| 亚洲自偷自偷图片| 亚洲国产成AV人天堂无码| 亚洲av永久中文无码精品综合 | 亚洲专区一路线二| 在线观看亚洲电影| 国产午夜免费高清久久影院| 和日本免费不卡在线v| 亚洲AV成人精品日韩一区18p| 亚洲AV无码欧洲AV无码网站| 亚洲AV成人一区二区三区在线看|