Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

3/03/2014

How to change VM image region (affinity group) in Microsoft Azure

Today, we needed to create a new virtual machine using an existing image in a different region that we worked so far. Due to the fact that images are region specific,we followed the steps above to create the VM:

  • Find the blob URL using Azure Portal. In VM section, there exists three tabs. One of them is images.Click this tab and find your image. Then look at image blob URL( i will call it source blob URL)
  • Create a storage and container in the region that you want to use image if you didnt do. I will call this container as destination base URL
  • Install Microsoft Azure Storage tools. It will be used to copy blob vhd item from one container to another. In current Azure Portal, there is no option to copy blob items. You can also do this by downloading the  vhd and upload it again manually.
azure account import {file path for publishsettings} (you can download publishsettings via shellscript,see next step)
azure vm disk upload {source url} {destination url} {destination storage password}

  •  Install Microsoft Azure ShellScript. It will be used to register your blob as an image.After you execute the command,operating system will be asked, write operating system that the image contains. For my case it was "windows".
 add-azureaccount 
get-azurepublishsettingsfile 
import-azurepublishsettingsfile {file path for downloaded publishsettings}
add-azureVMImage -ImageName {image name} -MediaLocation {destination url} -Label {label of image }


8/04/2010

Adding Python Files to your Boxee Projects

There are enough information about python files in the official Boxee documentation. Still there is some minor problems that I encountered while including pyhton file to my Boxee project.

1) .py file must be in same path with descriptor.xml .
2)Boxee creates a .pyo file after it compiled the code. .pyo file is used in the application. So if you change a piece of code in your .py file. It will not affect your application unless you delete existing .pyo file and restart the application.
3).pyo files can be created if python codes are syntactically correct.
4)Compiling .py files requires some time. So, if your python code is not large enough, just call from your xml file.
5)Your pyhton file need not to be named same as your project.
6)There is only a few application that are using .py files.
7)You need to import your .py file in order to use its content.
import name_of_py_file