Project

Profile

Help

Virtualization quickstart » History » Sprint/Milestone 2

kdelee@redhat.com, 07/26/2017 03:46 PM

1 1 kdelee@redhat.com
# Virtualization quickstart
2
3 2 kdelee@redhat.com
## Option 1: Using Vagrant with either libvirt or docker
4
5
See [Pulp Developer Setup](http://docs.pulpproject.org/dev-guide/contributing/dev_setup.html)
6
7
## Option 2: Using libvirt and Virtual Machine Manager on a Fedora 25 machine:
8
9 1 kdelee@redhat.com
Install the following packages:
10
11
`$ sudo dnf install libvirt qemu-kvm kvm libguestfs-tools virt-install`
12
13
Then, download an image for the OS you want to run in your VM.  
14
Here is a link to download an .iso for Fedora 26:  
15
https://getfedora.org/en/workstation/download/
16
17
To launch "Virtual Machine Manager" press Super key and search "Virtual Machine Manager"
18
19
1\) File -\> New Virtual Machine  
20
2\) Local install media  
21
\* use file browser to find your downloaded image  
22
3\) accept default settings
23
24
\==================================================
25
26 2 kdelee@redhat.com
### SETTING UP THE VM:
27 1 kdelee@redhat.com
28 2 kdelee@redhat.com
  - Start the VM with the "play button"
29
  - Choose to install fedora:
30
  - set hostname: give it a name other than localhost.
31
  - make it meaningful
32
  - set root password (weak one is OK)
33
  - if you make a user, make sure to give them sudo access
34
35 1 kdelee@redhat.com
\---------------------------  
36
NOTE:  
37
If you forgot to make "admin" have sudo access:  
38
Once VM is running, go to terminal and switch to root
39
40
`[root@VM0 admin]# gpasswd --add admin wheel`
41
42 2 kdelee@redhat.com
Then restart.
43 1 kdelee@redhat.com
44
\--------------------------  
45
\--------------------------  
46
WARNING:  
47
\`localhost\` is a BAD hostname. Each of your VMs should have a unique hostname. If you have cloned this VM from another, it will have the same hostname. This needs to change  
48
It is imperative that you change your hostname before installing any pulp components, as they use the hostname and can produce undefined behavior if the hostname is changed after the fact.
49
50
See your current hostname with:  
51
<code>  
52
$ echo $HOSTNAME
53
54
To change your hostname, run
55
56
$ sudo hostnamectl set-hostname DESIRED_NAME  
57
</code>  
58
\----------------------------
59
60
\==========================================================  
61 2 kdelee@redhat.com
h3. SETTING UP ANSIBLE (on the VM):
62 1 kdelee@redhat.com
63
Install the ansible package:
64
65
`$ sudo dnf install ansible git`
66
67
Ansible info:  
68 2 kdelee@redhat.com
For documentation see http://docs.ansible.com/
69 1 kdelee@redhat.com
70
Download the pulp_packaging repo:
71
72
`$ git clone https://github.com/pulp/pulp_packaging.git`
73
74
Now we need to make a \`hosts\` file for ansible. Use the results of the \`hostname\` command in the place of 'localhost':  
75
<code>  
76
$ cd pulp_packaging/ci/ansible  
77
$ cat \> hosts \<<EOF
78
> $(hostname)  
79
\> EOF  
80
</code>
81
82 2 kdelee@redhat.com
### Choosing what version of pulp to install
83
84 1 kdelee@redhat.com
To choose the version of pulp that you will install, edit the file:  
85 2 kdelee@redhat.com
`pulp_packaging/ci/ansible/roles/pulp/defaults/main.yaml`
86
87
OR pass `-e pulp_version=2.14 -e pulp_build=nightly` in the ansible-playbook invocation.
88
89 1 kdelee@redhat.com
OR in hosts file, specify pulp_version and pulp_build on the same line as hostname, i.e.  
90 2 kdelee@redhat.com
`Nameofhost pulp_version=2.14 pulp_build=nightly`
91 1 kdelee@redhat.com
92
Now you are ready to run the ansible playbook:  
93
`$ sudo ansible-playbook -i hosts -e ansible_connection=local pulp_server.yaml`  
94
\================================