Export-VMsnapshot command creates disk with dirty bit set.

Welcome Forums General PowerShell Q&A Export-VMsnapshot command creates disk with dirty bit set.

This topic contains 8 replies, has 4 voices, and was last updated by

 
Participant
2 weeks ago.

  • Author
    Posts
  • #112966

    Participant
    Points: 0
    Rank: Member

    Hi,
    I know my question is not exactly related to powershell issue, but I appreciate any help if possible....
    Our script creates disk from Microsoft VMM virtual machine snapshot which is used by the deployment team to create virtual machines. The disk created by export-VMsnapshot command sets the dirty bit on the disk. When a new virtual machine is created from that disk it boots to trigger check disks.
    Thanks,
    Kishor

  • #113003

    Keymaster
    Points: 1
    Rank: Member

    Yeah, unfortunately that's something "inside" that command, not PowerShell per se. You'd probably need to contact MS support if you feel this is a bug condition.

  • #113024

    Participant
    Points: 20
    Rank: Member
  • #113080

    Participant
    Points: 0
    Rank: Member

    Not an answer but it's most likely down to how the snapshot is created and what the tool do with the snapshot afterwards.

    E.g. if the tool creates a VSS snapshot and then make the snapshot write-able, then when creating a new drive from that snapshot, it will be seen as a "crash" state version of the drive.

    • #113138

      Participant
      Points: 0
      Rank: Member

      Hi Fredrik,

      To add to my question this issue is with only one virtual machine whereas other machine whose snapshot is used are working fine with same process.

      Thanks,

      kishor

  • #113182

    Participant
    Points: 0
    Rank: Member

    Then I would start checking if the snapshot fails/logs errors for that virtual machine for some reason.

    A quick test would be to shutdown the vm, take snapshot, then create a new VM from that snapshot.

    • #113252

      Participant
      Points: 0
      Rank: Member

      Hi Fredrik,

      Yes, I have already tried this option of creating a new VM from snapshot but in vain. This VM was clean but as our SCO workflow runs a export-vmsnapshot on another checkpoint from this machine the output vhdx we again got was also with dirty bit set.

      Kishor

    • #113333

      Participant
      Points: 0
      Rank: Member

      Hi Fredrik,

      I observed situation which matches to what you mentioned in your previous post 'it will be seen as a "crash" state version of the drive'.

      On the new VM which I create using the vhdx , if I skip chkdsk it loads OS and shows 'unexpected shutdown' box to me...

      Kishor

  • #113372

    Participant
    Points: 0
    Rank: Member

    Yes, then that is the reason why you get a dirty disk since it apparently is in a crash state rather than a graceful state.

    In Windows Server 2016 they introduced "Production" checkpoints which basically leverages VSS in the VM to make sure it's in a application consistent state when doing the checkpoints.

    You can read more about it here:

    https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/manage/choose-between-standard-or-production-checkpoints-in-hyper-v

You must be logged in to reply to this topic.