[PVE-User] creating/hotplug new drive from command line

Alexandre DERUMIER aderumier at odiso.com
Wed Oct 1 17:59:47 CEST 2014





	

Alexandre Derumier 
Ingénieur système et stockage 


Fixe : 03 20 68 90 88 
Fax : 03 20 68 90 81 


45 Bvd du Général Leclerc 59100 Roubaix 
12 rue Marivaux 75002 Paris 


MonSiteEstLent.com - Blog dédié à la webperformance et la gestion de pics de trafic 

----- Mail original ----- 

De: "Dhaussy Alexandre" <ADhaussy at voyages-sncf.com> 
À: pve-user at pve.proxmox.com 
Envoyé: Mardi 30 Septembre 2014 18:38:22 
Objet: [PVE-User] creating/hotplug new drive from command line 

Hello, 

I have been doing some research to automate this...I found something 
that works but it seems a bit complicated. 
Maybe there is a better way ? 

$ qemu-img-create /glusterstorage/images/150/vm-150-disk-2.raw 30G 

$ /usr/bin/expect -c 'spawn qm monitor 150; send "drive_add auto 
file=/glusterstorage/images/150/vm-150-disk-2.raw,id=drive-virtio-disk2,if=none\r"; 
send "quit\r"; expect eof' 

$ /usr/bin/expect -c 'spawn qm monitor 150; send "device_add 
virtio-blk-pci,scsi=on,drive=drive-virtio-disk2\r"; send "quit\r"; 
expect eof' 

$ qm set 150 -virtio2 glusterstorage:150/vm-150-disk-2.raw 

-- 
Regards, 
Alexandre. 
_______________________________________________ 
pve-user mailing list 
pve-user at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-user 



More information about the pve-user mailing list