Skip to main content

Posts

Showing posts with the label hyper-v

QUÁ TRÌNH MIGRATE LÊN GOOGLE CLOUD

      QUÁ TRÌNH MIGRATE LÊN GOOGLE CLOUD - Mục tiêu: chuyển máy chủ ảo (Hyper-V) lên Google Cloud Bước 1: xác định chi phí - Chọn cấu hình, dung lượng - Chọn khu vực: độ trễ thấp/cao, low CO2 - Cam kết sử dụng liên tục - Chọn gói backup (nếu cần) Bước 2: tạo Bucket Store - Chọn Region - Zone phù hợp (càng gần server càng tốt),  - Zone (a,b,c) thì latency thấp nhất nhưng giá cao nhất. Thực tế, chỉ cần chọn đến Region là OK nhất, tốc độ nhanh mà giá rẻ chỉ 1/5 so với Zone. Chọn Zone thì nhanh hơn được 1 chút xíu nhưng mắc. Bước 3: thu gọn server ảo - Chuẩn bị export : dọn dẹp server ảo cho gọn nhất,  - Chạy lệnh optimize để xóa block rỗng:  Optimize-VHD -Path "C:\path\to\your\image.vhdx" -Mode Full Bước 4: Cài đặt & kết nối Google Cloud CLI Bước 5: Upload vhdx - Mẹo: chạy lệnh chia nhỏ gói data:  gcloud config set storage/parallel_composite_upload_threshold 150M - Upload:  gcloud storage cp "C:\path\to\your\file.vhdx" gs://ten-bucket/

LỖI Hyper-V encountered an error trying to access an object on computer ‘localhost’ because the object was not found

 Hyper-V gặp lỗi trống giao diện quản lý VM dù rằng các service và VM vẫn start lên bình thường. Run the following command from an Elevated (Administrator) command prompt or PowerShell.  Winkey+X >>  Windows PowerShell ( A dmin) MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof Nguyên nhân: có thể do install hoặc remove 1 phần mềm nào đó gây ra hư hỏng Source: https://shauncassells.wordpress.com/2018/05/24/fix-hyper-v-encountered-an-error-trying-to-access-an-object-on-computer-localhost-because-the-object-was-not-found-the-object-might-have-been-deleted-verify-that-the-virtual-machine-managemen/

WINDOWS 2012 DEDUPLICATION – TURNING IT OFF (COMPLETELY) AND RECOVERING YOUR SPACE!

  A while back i wrote a post about data deduplication in 2012…. generally a very good feature, but as that specific post talked about, there was a collection of .iso and compressed data where not only did dedup not save me anything, it actually used up more space in the dedup folder than the orginal data size (which i found a little odd) Today i got around to doing something about this and found Disabling data deduplication (via GUI or powershell) only stops further deduplication from occuring – but data that has already been deduplicated will remain deduplicated In order to “move” (re-hydrate ?) the data back to the original files and out of the deduplication store, use the powershell command  start-dedupjob -Volume <VolumeLetter> -Type Unoptimization You can check the status on where this is at by using  get-dedupjob , or, i like using TreeSize which shows the size on disk of specific files…. including the deduplication chunks At this stage – i noticed the o...

Hyper-V Planned Failover

AFTER PLANNED FAILOVER Primary vm: server A Replica vm: server B Step 1: Update append data by reverse replication Shutdown server B Wait for merge completed Step 2: Then start a new planned failover from server B Start server A Apply reverse replication to back normal

LỖI HYPER-V “FAILED TO CHANGE CURRENT STATE”

LỖI “FAILED TO CHANGE CURRENT STATE” Hôm nay mình có thao tác mount cái disk máy ảo (VHDX) rồi copy và create file trực tiếp trong cái disk ảo đó (mounted-disk) Dẫn đến là sau khi start lại VM thì báo lỗi “ Failed to change current state ”. Nguyên nhân là do việc copy & tạo file trực tiếp trong mounted-disk làm cho disk không còn đúng trạng thái ban đầu . Máy ảo này có 2 disk: disk 1 làm OS, disk 2 làm Data.Tìm hiểu kỹ hơn bằng tính nằng “ Inspect disk ” thì phát hiện disk 1 bị lỗi “ Property ‘MaxinternalSize’ does not exist in class ‘Msvm_VirtualHardDiskSettingData’ .” Nguyên nhân như đã nói ở trên, nó làm cho các bản Checkpoint (Snapshot) mất link với Disk gốc (Parent disk) Để khắc phục, chúng ta cần dùng lệnh Set-VHD để link Checkpoint với Parent Disk ·         Cần chạy lệnh với quyền Administrator “ Run as administrator ” ·         set-vhd "D:\Hyper-V-Replica\Virtual Hard Disks\XXX-d...

Hyper-V Checkpoints: Why, When and How to Use Them

Hyper-V Checkpoints: Why, When and How to Use Them Hyper-V   January 18, 2019   Posted by:  Maria Talley Before making changes in Hyper-V, whether it involves software configuration changes or a new software update, it's a good idea to first create a Hyper-V  checkpoint . A  Hyper-V checkpoint  follows the same idea of the more well-known Microsoft Windows  restore point   that many Windows users have utilized in the past before adding new applications or making other system changes to their machines. Hyper-V checkpoints allow IT administrators to easily save the existing state of a virtual machine before any changes are made so that if a problem crops up due to the changes, the VM can revert to its previous state. That's a very useful feature for VM administrators, since new configuration changes can always potentially bring new challenges to enterprise IT systems. Two types of checkpoints are available for use ...

HYPER V - LỖI KHÔNG ENABLE ĐƯỢC REPLICA SERVER

HYPER V - LỖI KHÔNG ENABLE ĐƯỢC REPLICA SERVER Server Hyper-V vẫn hoạt động bình thường, trước giờ vẫn làm Hyper-V Source replica, giờ chuyển qua làm destination replica thì nhận được báo lỗi hyper v failed to enable the replica server using kerberos authentication Kiểm tra trong event log thì thấy có dòng lỗi khả nghi như sau: Nguyên nhân : có lẽ là do setting làm source replica trước đó, nên trong network interface không có dòng cấu hình ListenIP Khắc phục: chạy CMD với quyền administrator, add thêm dòng cấu hình iplisten vào Bật lại Enable Replica thành công

HYPER-V - LỖI MOVE MÁY ẢO KHÁC CPU VẬT LÝ

Khi move các máy ảo từ server này qua server khác, đôi khi sẽ gặp tình huống khác phần cứng (CPU, model v.v..) như lỗi sau: Cách khắc phục: Tắt máy ảo cần move Vào Setting của máy ảo - Processor - Compatibility Chọn " Migrate to a physical computer with a different processor version " 

SERVER 2016 - LỖI HYPER-V KHÔNG MỞ ĐƯỢC MANAGEMENT

SERVER 2016 - LỖI HYPER-V KHÔNG MỞ ĐƯỢC MANAGEMENT  Mới cài server 2016, hí hửng mở Hyper-V lên để action và ...wtf....các services đều bình thường, mọi thứ bình thường, vậy là sao?? Gặp cái vụ này cần chạy dòng code sau trong Powershell để build lại cái WMI Component. MS lúc nào cũng gài ae IT những cái lỗi lặt vặt tào lao như thế này Run “ MOFCOMP %SYSTEMROOT%\System32\WindowsVirtualization.V2.mof ” This rebuilds the WMI components for virtualization. [edit for clarity] This is run on the Hyper-V host. Voila! Nguồn:  https://community.spiceworks.com/how_to/122307-fix-error-managing-hyper-v-server-2012-r2-from-windows-10

[HYPER-V] LỖI "ENABLING REPLICATION FAILED" DO ISCSI DISKS ATTACHED

LỖI "ENABLING REPLICATION FAILED" DO ISCSI DISKS ATTACHED Khi enable replication cho 1 server có gắn card iSCSI sẽ bị lỗi như bên dưới  Nguyên nhân là do tính năng backup (checkpoint) của Hyper-V host lock. Vì vậy cần phải disable tính năng này, làm như sau: Vào Setting - Intergration Services của máy ảo Clear mục " Backup (Volume checkpoint)"

[Hyper-V] - Lỗi không boot vào được sau khi convert máy vật lý sang máy ảo

XỬ LÝ LỖI KHÔNG BOOT ĐƯỢC VÀO MÁY ẢO SAU KHI CONVERT TỪ MÁY VẬT LÝ BẰNG DISK2VHD Sau khi convert server vật lý sang file VHD để import vào Hyper thì khi start máy ảo lên màn hình máy ảo chỉ nhấp nháy con trỏ chuột trên màn hình đen (blinking cursor) NGUYÊN NHÂN Do máy vật lý sử dụng ổ đĩa cài OS được format theo chuẩn GPT (thay vì MBR như truyền thống, tham khảo GPT và MBR ) XỬ LÝ Bước 1: chuyển ổ GPT thành MBR Copy file VHD của ổ đĩa chứa OS về 1 máy tính Windows 8 trở lên Trên máy Windows 8+ click phải chuột lên file VHD vừa copy, chọn lệnh Mount . Lúc này dùng 1 phần mềm miễn phí (vd: Mini Partition Wizard ) để convert ổ đĩa vừa mount từ GPT  -> MBR Sau đó Delete phần Partition dư ra ở phần đầu ổ đĩa được mount (khoảng vài trăm MB) Set " Active " cho ổ đĩa này để là ổ đĩa boot OS Nhấn Apply để phần mềm thực thi tác vụ Sau khi phần mềm làm xong, tắt phần mềm Mini Partition Wizard, vào My Computer chọn eject ổ đĩa đang mount . Copy file VHD vừa đư...

Lỗi hyper-v could not delete a temporary version of this virtual machine

Gặp lỗi hyper-v could not delete a temporary version of this virtual machine Trong quá trình vận hành ảo hóa Hyper-V đôi lúc chúng ta cần phải thực hiện 1 số công tác di dời - đồng bộ máy ảo để bảo trì, thay thế server vật lý thật. Và rủi ro trong khi đang di dời thì 1 trong số các server Source (tạm gọi Host1) và Destination (tạm gọi Host2) bị problem (mất kết nối, shutdown, reboot, crash v.v..) làm cho việc move hoặc replicate chưa kịp hoàn tất. Khi resume lại công tác đó chúng ta sẽ gặp 1 số lỗi như " hyper-v could not delete a temporary version of this virtual machine " hoặc chỉ là " failed " Nguyên nhân: Do khi bắt đầu công tác move - replicate thì máy chủ Host1 sẽ tiến hành copy các bộ xml của máy ảo lên máy chủ Host2, và khi chúng ta resume sau sự cố thì các file xml này vẫn còn tồn tại trên server Host2, dù rằng trong console quản lý Hyper-V không thấy (do chưa hoàn tất nên chưa hiện lên thôi). Xử lý: Bạn vào C:\ProgramData\Microsoft\Windows\H...