<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Windows Virtualization Team Blog : import</title><link>http://blogs.technet.com/virtualization/archive/tags/import/default.aspx</link><description>Tags: import</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Hyper-V R2 Import/Export – Part 2 - The New Import/Export APIs</title><link>http://blogs.technet.com/virtualization/archive/2009/05/21/hyper-v-r2-import-export-part-2-the-new-import-export-apis.aspx</link><pubDate>Thu, 21 May 2009 19:51:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3243925</guid><dc:creator>SoumyaDB</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.technet.com/virtualization/comments/3243925.aspx</comments><wfw:commentRss>http://blogs.technet.com/virtualization/commentrss.aspx?PostID=3243925</wfw:commentRss><description>&lt;P&gt;&lt;FONT size=2&gt;To enable the new functionality of Import/Export we now have new ‘Ex’ versions of the Import/Export APIs along with settings data objects that allow the user to tweak the necessary parameters upon export or import:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;FONT size=2&gt;Export:&lt;/FONT&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Before you run an export, you can get the export parameters associated with a VM in the form of a settings data object. They are populated with default values. You can modify the parameters you need and then call ExportVirtualSystemEx with the modified object passed in.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;ExportVirtualSystemEx: &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd379583(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd379583(VS.85).aspx"&gt;&lt;FONT size=2&gt;http://msdn.microsoft.com/en-us/library/dd379583(VS.85).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Export Setting data: &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd379576(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd379576(VS.85).aspx"&gt;&lt;FONT size=2&gt;http://msdn.microsoft.com/en-us/library/dd379576(VS.85).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;FONT size=2&gt;Import:&lt;/FONT&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Before you run an import, you can get the import parameters for the directory the VM will be imported from. Here, you can tweak interesting parameters like the AzMan security scope, network connections and even paths to VHDs before calling ImportVirtualSystemEx with the modified parameters.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;ImportVirtualSystemEx: &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd379583(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd379583(VS.85).aspx"&gt;&lt;FONT size=2&gt;http://msdn.microsoft.com/en-us/library/dd379583(VS.85).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Import Setting data: &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd379577(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd379577(VS.85).aspx"&gt;&lt;FONT size=2&gt;http://msdn.microsoft.com/en-us/library/dd379577(VS.85).aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;While I will not repeat the information in the MSDN documentation, there are some salient points about the API worth calling out:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=2&gt;Export Settings data (&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd379576(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd379576(VS.85).aspx"&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;Msvm_VirtualSystemExportSettingData&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=2&gt;):&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Here is a dump of the parameters from powershell:&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;Caption                    : Virtual System Export Setting Data&lt;/PRE&gt;&lt;PRE&gt;CopySnapshotConfiguration  : 0&lt;/PRE&gt;&lt;PRE class=alt&gt;CopyVmRuntimeInformation   : True&lt;/PRE&gt;&lt;PRE&gt;CopyVmStorage              : True&lt;/PRE&gt;&lt;PRE class=alt&gt;CreateVmExportSubdirectory : False&lt;/PRE&gt;&lt;PRE&gt;Description                : Microsoft Virtual System Export Setting Data&lt;/PRE&gt;&lt;PRE class=alt&gt;ElementName                : Microsoft Virtual System Export Setting Data&lt;/PRE&gt;&lt;PRE&gt;InstanceID                 : Microsoft:4919C848-AA71-43B3-A1A5-988242D39FA2&lt;/PRE&gt;&lt;PRE class=alt&gt;SnapshotVirtualSystem      :&lt;/PRE&gt;&lt;/DIV&gt;
&lt;STYLE type=text/css&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/STYLE&gt;

&lt;STYLE type=text/css&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/STYLE&gt;

&lt;P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size=2&gt;CopyVmRuntimeInformation: you can specify if you want to export your saved state files or not. This is particularly useful if you are interested only in the storage associated with VM or if you are moving a VM across processor vendors, the saved state files will be useless as a result and you could live without the 1 or 2 GB worth of memory data on the pipe. &lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=2&gt;CopyVmStorage is the essential parameter that controls config-only export. That is the parameter you want to set to false if you want to do config-only export. &lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size=2&gt;CopySnapshotConfiguration and SnapshotVirtualSystem can be used together to export a single snapshot &lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=2&gt;Import Settings data (&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd379577(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd379577(VS.85).aspx"&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;Msvm_VirtualSystemImportSettingData&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=2&gt;):&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Here is the dump of the parameters from powershell: &lt;/FONT&gt;&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;Caption                  : Virtual System Import Setting Data&lt;/PRE&gt;&lt;PRE&gt;CreateCopy               : True&lt;/PRE&gt;&lt;PRE class=alt&gt;CurrentResourcePaths     : {C:\7088\blog.vhd}&lt;/PRE&gt;&lt;PRE&gt;Description              : Microsoft Virtual System Import Setting Data&lt;/PRE&gt;&lt;PRE class=alt&gt;ElementName              : Microsoft Virtual System Import Setting Data&lt;/PRE&gt;&lt;PRE&gt;GenerateNewId            : True&lt;/PRE&gt;&lt;PRE class=alt&gt;InstanceID               : Microsoft:ADDB3F5B-17BF-4AB4-A21F-BF1EE41B0165&lt;/PRE&gt;&lt;PRE&gt;Name                     : blog&lt;/PRE&gt;&lt;PRE class=alt&gt;SecurityScope            :&lt;/PRE&gt;&lt;PRE&gt;SourceNetworkConnections :&lt;/PRE&gt;&lt;PRE class=alt&gt;SourceResourcePaths      : {C:\blog_VM\runtime\Virtual Hard Disks\blog.vhd}&lt;/PRE&gt;&lt;PRE&gt;SourceSnapshotDataRoot   :&lt;/PRE&gt;&lt;PRE class=alt&gt;SourceVhdDataRoot        :&lt;/PRE&gt;&lt;PRE&gt;SourceVmDataRoot         :&lt;/PRE&gt;&lt;PRE class=alt&gt;TargetNetworkConnections :&lt;/PRE&gt;&lt;PRE&gt;TargetResourcePaths      :&lt;/PRE&gt;&lt;PRE class=alt&gt;TargetSnapshotDataRoot   :&lt;/PRE&gt;&lt;PRE&gt;TargetVhdDataRoot        :&lt;/PRE&gt;&lt;PRE class=alt&gt;TargetVmDataRoot         :&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;STYLE type=text/css&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/STYLE&gt;

&lt;P&gt;&lt;U&gt;&lt;FONT size=2&gt;Source vs. Target:&lt;/FONT&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Over here, you can clearly see a larger number of parameters. In particular, there are a number of “Source…” prefixed and “Target...” prefixed parameters. Since we now do a copy on import, you could view the “Source…” prefixed parameters as specifying the “from” location of the copy and the “Target…” prefixed parameters as the “to” location of the copy. The SourceResourcePaths parameter is an array populated with the VHDs associated with the VM. Here the user can specify the locations of the VHDs to copy from. They do not necessarily need to be under the import folder. Correspondingly, the TargetResourcePaths parameter is an array with paths that specify where the VHDs are to be copied to.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;However, if you do not want to do a copy on import, (ie: you set the CreateCopy parameter to false), you do not need to specify any of the “Target…” prefixed parameters. Hyper-V will use the “Source…” prefixed parameters to configure the VM upon import.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;FONT size=2&gt;Dataroots vs. ResourcePaths&lt;/FONT&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;On another dimension, you have the dataroots (SourceSnapshotDataRoot, SourceVhdDataRoot, SourceVmDataRoot) and the resourcepaths (SourceResourcePaths and TargetResourcePaths). Say, if all your VHDs reside in a single directory that you want to import from, specifying the SourceVhdDataRoot will be sufficient. Also, if upon import you want all the VHDs to reside in a single folder, just specify the TargetVhdDataRoot and you are done. You do not need to specify each of the TargetResourcePaths. The same logic applies to the (Source/Target)SnapshotDataRoot and (Source/Target)VmDataRoot.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3243925" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/virtualization/archive/tags/Hyper-V/default.aspx">Hyper-V</category><category domain="http://blogs.technet.com/virtualization/archive/tags/export/default.aspx">export</category><category domain="http://blogs.technet.com/virtualization/archive/tags/import/default.aspx">import</category></item><item><title>Hyper-V R2 Import/Export – Part 1 – The Case for New Import/Export Functionality</title><link>http://blogs.technet.com/virtualization/archive/2009/05/20/hyper-v-r2-import-export-part-1-the-case-for-new-import-export-functionality.aspx</link><pubDate>Wed, 20 May 2009 07:13:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3242715</guid><dc:creator>SoumyaDB</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/virtualization/comments/3242715.aspx</comments><wfw:commentRss>http://blogs.technet.com/virtualization/commentrss.aspx?PostID=3242715</wfw:commentRss><description>&lt;P&gt;This is the first blog entry of a multi-part series of blogs that addresses Import/Export in Windows Server 2008 R2. This blog talks about the scenarios enabled by the changes made to import/export in R2.&lt;/P&gt;
&lt;P&gt;Ben Armstrong had blogged earlier about the intricacies of Import and Export with v1 Hyper-V in his blog posts:&lt;BR&gt;&lt;A href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/08/26/hyper-v-export-import-part-1.aspx" mce_href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/08/26/hyper-v-export-import-part-1.aspx"&gt;http://blogs.msdn.com/virtual_pc_guy/archive/2008/08/26/hyper-v-export-import-part-1.aspx&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/08/27/hyper-v-export-import-part-2.aspx" mce_href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/08/27/hyper-v-export-import-part-2.aspx"&gt;http://blogs.msdn.com/virtual_pc_guy/archive/2008/08/27/hyper-v-export-import-part-2.aspx&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Now, the big problem with how import export worked in v1 was that it just did not give the user enough control over the process of exporting and more significantly, importing a VM. Additionally, it was rather unforgiving. I bet many a user has been burnt trying to import a VM a second time only to find out that since he/she had imported it once already, the import folder could not be used anymore.&lt;/P&gt;
&lt;P&gt;So, introducing the R2 version of Import Export: a lot more fine grained control on the entire process as well as added capabilities that are more in tune with user needs. Here is a list of capabilities enabled with the new Import Export functionality:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;U&gt;Copy on Import:&lt;/U&gt; The R2 Import/Export APIs now allow the user to specify a location to import to and not use the import directory as the VM's execution directory. Thus, the user can now create a "gold VM", export it once to a file share and then import it multiple times from that file share. This capability ends up enabling a number of scenarios as a result:&lt;BR&gt;a. Backup-restore: For the users who do not want to use a backup application to backup their VMs, they can use import/Export and can restore the same files multiple times. Additionally, they can now have their backup media as read-only.&lt;BR&gt;b. Moving/Cloning VMs: The users do not need to do a separate file copy operation in order to move a VM now. They just have to export to a file share and then import it. Additionally, at import time, the user can now specify where to place the VM on the target machine.&lt;/LI&gt;
&lt;LI&gt;&lt;U&gt;Export of a Snapshot&lt;/U&gt;: Picture this in the v1 days of Hyper-v: Tester Fred is running a number of tests using virtual machines. During the course of the tests, he takes snapshots at different points in time. Now, after snapshot #5 of 20, he sees a bug. So, he would like the developer to take a look at it. However, he would need to export the entire VM and all its snapshots in order to do that. In R2, he can export snapshot #5 as a separate and independent VM and send it to the developer to debug. &lt;BR&gt;Additionally, this functionality has enabled another scenario in the IT arena: IT Admin John has a staging environment where he experiments with a number of versions of software in a VM to determine which works best for his scenario. Using R2 Hyper-V, he can create snapshots for each version of the software being tried out. When he determines a version that would work best in his deployment, all he has to do is to export that snapshot and then import it as an independent VM in the production machines. &lt;/LI&gt;
&lt;LI&gt;&lt;U&gt;Fine grained control&lt;/U&gt;: In R2, we have a much richer APIs for Export and Import, enabling the user to tweak parameters like VHD paths, network connections and AzMan during import. Additionally, these parameters can be modified regardless of how the export was carried out. In v1, if the users did a full export (ie: export with configuration as well as VHDs), there was little available to the user to tweak upon import. If they exported config only, they had to edit the config.xml file upon import. None of that in R2. All the parameters can now be tweaked via the import APIs. More on this in the following blog&lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3242715" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/virtualization/archive/tags/Hyper-V/default.aspx">Hyper-V</category><category domain="http://blogs.technet.com/virtualization/archive/tags/export/default.aspx">export</category><category domain="http://blogs.technet.com/virtualization/archive/tags/import/default.aspx">import</category></item></channel></rss>