Ask Your Question
1

How to attach volume to Windows [closed]

asked 2014-04-14 08:28:52 -0500

Alex Feldman gravatar image

I have a Windows instance in OpenStack with cloudbase-init installed. I've created a volume in the OpenStack environment. What steps should I follow to attach the volume to my Windows instance so that it shows up as a new Drive letter?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Bill@Metacloud
close date 2014-04-24 10:38:54.360882

2 answers

Sort by ยป oldest newest most voted
3

answered 2014-04-14 11:42:28 -0500

updated 2014-04-14 11:51:22 -0500

I just went thru the steps to do this, I have done this in linux, but never in windows. Good news is I now have a "D" volume in my windows system.

Here is what I did:

1. Create your volume in openstack
2. Attach it to your running Windows instance (I am using Windows 7)
3. Next go to the device manager in windows, you should now see two virt-io devices, and the second one is the new one.

image description

4. I forced it to populate the data - which showed me it was the 2G volume I created. It was disk1
5. Now - I rebooted at this point.
6. after Reboot - went to the Windows partition manager, I now see disk1, a blank disk. Note disk0 is the windows boot drive do not format it.

image description

7. I created a partition, and formated it as a simple NTFS volume and mapped it do the letter D:
8. Cool, now I see it under the file manager and just copied a bunch of data to it, seems to work fine.
9. All done. Very cool.

image description

edit flag offensive delete link more

Comments

I didn't have to do steps 4 Force Populate (not sure what you mean there) and 5 Reboot but the rest worked for me.

Alex Feldman gravatar imageAlex Feldman ( 2014-04-17 10:56:41 -0500 )edit

Very Nice, I did the force populate just to make sure it was there, sort of a re-read. Glad it worked.

Bill@Metacloud gravatar imageBill@Metacloud ( 2014-04-24 10:38:18 -0500 )edit
3

answered 2014-04-14 14:10:40 -0500

alexpilotti gravatar image

updated 2014-04-14 14:11:35 -0500

By default Cinder volumes are unpartitioned, you can partition a new volume very easily in PowerShell:

$d = Get-Disk | where {$_.OperationalStatus -eq "Offline" -and $_.PartitionStyle -eq 'raw'}
$d | Set-Disk -IsOffline $false
$d | Initialize-Disk -PartitionStyle MBR
$p = $d | New-Partition -UseMaximumSize -DriveLetter "E"
$p | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Volume1" -Confirm:$false

This script puts the disk online, initializes it, creates a partition and formats the volume, assigning the letter "E" and label "volume1"

Use -AssignDriveLetter if you prefer to get the first available letter.

Note: we're planning to add this feature to Cloudbase-Init, so that volumes get automatically initialized on boot.

Alessandro

edit flag offensive delete link more

Comments

1

Thank you Alessandro. You script does not check whether the volume has been formatted already. Can you modify the script so that it preserves contents in the volume if the volume has been used already???

AndyHoho gravatar imageAndyHoho ( 2015-10-05 09:52:50 -0500 )edit

But before we add how to add the cinder volume to the virtual machine? Also, can we automate the powrshell script to run during the startup like a bootstrap script?

Nagesh gravatar imageNagesh ( 2016-07-05 22:28:43 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-04-14 08:28:52 -0500

Seen: 3,519 times

Last updated: Apr 14 '14